1
0
mirror of https://github.com/deadc0de6/dotdrop.git synced 2026-02-05 03:19:43 +00:00
This commit is contained in:
deadc0de6
2021-09-22 11:19:55 +02:00
parent 55e6ff46b8
commit 89aa981944
2 changed files with 7 additions and 7 deletions

View File

@@ -436,7 +436,7 @@ class CfgYaml:
if self._debug:
self._dbg('saving to {}'.format(self._path))
try:
with open(self._path, 'w') as file:
with open(self._path, 'w', encoding='utf8') as file:
self._yaml_dump(content, file)
except Exception as exc:
self._log.err(exc)
@@ -581,9 +581,9 @@ class CfgYaml:
uvars = {}
if not self._reloading and uvariables:
for k, v in uvariables.items():
content = userinput(v, debug=self._debug)
uvars[k] = content
for name, prompt in uvariables.items():
content = userinput(prompt, debug=self._debug)
uvars[name] = content
if uvars:
uvars = uvars.copy()
@@ -1105,7 +1105,7 @@ class CfgYaml:
if self._debug:
self._dbg('----------start:{}----------'.format(path))
cfg = '\n'
with open(path, 'r') as file:
with open(path, 'r', encoding='utf8') as file:
for line in file:
cfg += line
self._dbg(cfg.rstrip())
@@ -1150,7 +1150,7 @@ class CfgYaml:
@classmethod
def _yaml_load(cls, path):
"""load from yaml"""
with open(path, 'r') as file:
with open(path, 'r', encoding='utf8') as file:
data = yaml()
data.typ = 'rt'
content = data.load(file)

View File

@@ -183,7 +183,7 @@ class Templategen:
path = os.path.normpath(path)
if not os.path.exists(path):
raise TemplateNotFound(path)
with open(path, 'r') as file:
with open(path, 'r', encoding='utf8') as file:
content = file.read()
return content