Skip to content

Commit

Permalink
Fix: io.UnsupportedOperation: not readable (stitionai#489)
Browse files Browse the repository at this point in the history
Co-authored-by: Андрей Васильев <[email protected]>
  • Loading branch information
FroDK and Андрей Васильев authored Apr 25, 2024
1 parent 1c8450b commit c21647d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ def __new__(cls):
def _load_config(self):
# If the config file doesn't exist, copy from the sample
if not os.path.exists("config.toml"):
with open("sample.config.toml", "r") as f_in, open("config.toml", "w") as f_out:
with open("sample.config.toml", "r") as f_in, open("config.toml", "w+") as f_out:
f_out.write(f_in.read())
f_out.seek(0)
self.config = toml.load(f_out)
else:
# check if all the keys are present in the config file
Expand Down

0 comments on commit c21647d

Please sign in to comment.