open and close config file with

utf-8 encoding
This commit is contained in:
dmunozv04
2024-01-15 21:53:08 +01:00
parent 04533162cb
commit 4e3c9d115c

View File

@@ -72,7 +72,7 @@ class Config:
def __load(self): def __load(self):
try: try:
with open(self.config_file, "r") as f: with open(self.config_file, "r", encoding="utf-8") as f:
config = json.load(f) config = json.load(f)
for i in config: for i in config:
if i not in config_file_blacklist_keys: if i not in config_file_blacklist_keys:
@@ -108,7 +108,7 @@ class Config:
print("Blank config file created") print("Blank config file created")
def save(self): def save(self):
with open(self.config_file, "w") as f: with open(self.config_file, "w", encoding="utf-8") as f:
config_dict = self.__dict__ config_dict = self.__dict__
# Don't save the config file name # Don't save the config file name
config_file = self.config_file config_file = self.config_file