forked from platformio/platformio-core
Specify encoding for "open()" functions
This commit is contained in:
1 parent
b9219a2b62
commit
d819617d2b
28 files changed
+63
-43
No files matched your search
@@ -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)
|
||||
|
||||
@@ -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
|
||||
Reference in new issue
Block a user