Specify encoding for "open()" functions

This commit is contained in:
Ivan Kravets committed 2021-08-28 13:10:07 +03:00
1 parent b9219a2b62
commit d819617d2b
28 files changed
+63 -43

No files matched your search

+1 -1
View File
@@ -456,7 +456,7 @@ class ProjectConfig(ProjectConfigBase, ProjectConfigDirsMixin):
path = path or self.path
if path in self._instances:
del self._instances[path]
with open(path or self.path, "w+") as fp:
with open(path or self.path, mode="w+", encoding="utf8") as fp:
fp.write(CONFIG_HEADER.strip() + "\n\n")
self._parser.write(fp)
fp.seek(0)
+1 -1
View File
@@ -177,6 +177,6 @@ def _load_cached_project_ide_data(project_dir, env_names):
for name in env_names:
if not os.path.isfile(os.path.join(build_dir, name, "idedata.json")):
continue
with open(os.path.join(build_dir, name, "idedata.json")) as fp:
with open(os.path.join(build_dir, name, "idedata.json"), encoding="utf8") as fp:
result[name] = json.load(fp)
return result