Skip to content

Commit c232347

Browse files
committed
python: open UtilConfig files as binary
Problem: The Python 3.11 tomllib implementation requires that toml files be opened in binary mode, but the UtilConfig class opens files in normal read mode, resulting in a TypError File must be opened in binary mode, e.g. use `open('foo.toml', 'rb')` Open all UtilConfig config files with mode 'rb'. This doesn't seem to cause an issue with other config file types. Fixes #5154
1 parent bb5ee6e commit c232347

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/bindings/python/flux/util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1042,7 +1042,7 @@ def load(self):
10421042
continue
10431043

10441044
try:
1045-
with open(filepath) as ofile:
1045+
with open(filepath, "rb") as ofile:
10461046
conf = self.extension_handlers[ppath.suffix](ofile)
10471047
except (
10481048
tomllib.TOMLDecodeError,

0 commit comments

Comments
 (0)