fix: encoding on windows

This commit is contained in:
Hellow
2023-10-12 23:24:32 +02:00
parent 8cae9b00a0
commit ff8dd76190
5 changed files with 7 additions and 11 deletions

View File

@@ -50,8 +50,8 @@ class Config:
return "\n".join(component.toml_string for component in self.component_list)
def write(self):
with self.config_file.open("w") as conf_file:
conf_file.write(self.toml_string, encoding="utf-8")
with self.config_file.open("w", encoding="utf-8") as conf_file:
conf_file.write(self.toml_string)
def read(self):
if not self.config_file.is_file():
@@ -60,7 +60,7 @@ class Config:
return
toml_data = {}
with self.config_file.open("r") as conf_file:
with self.config_file.open("r", encoding="utf-8") as conf_file:
toml_data = toml.load(conf_file)
for component in self.component_list: