Skip to content

Commit

Permalink
explicite utf-8 config encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
PJDude committed Feb 7, 2024
1 parent f792f77 commit fe9aae2
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/dude.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,14 +145,17 @@ def __init__(self,config_dir):
def write(self):
l_info('writing config')
Path(self.path).mkdir(parents=True,exist_ok=True)
with open(self.file, 'w') as configfile:
self.config.write(configfile)
try:
with open(self.file, 'w',encoding='utf-8') as configfile:
self.config.write(configfile)
except Exception as e:
l_error(e)

def read(self):
l_info('reading config')
if path_isfile(self.file):
try:
with open(self.file, 'r') as configfile:
with open(self.file, 'r',encoding='utf-8') as configfile:
self.config.read_file(configfile)
except Exception as e:
l_error(e)
Expand Down

0 comments on commit fe9aae2

Please sign in to comment.