Skip to content

Commit

Permalink
Merge branch 'bugfix/saving-esp-idf-env-as-utf8-v5.1' into 'release/v…
Browse files Browse the repository at this point in the history
…5.1'

build system: fix init.bat crash in windows when folder contains unicode characters (v5.1)

See merge request espressif/esp-idf!24666
  • Loading branch information
Zim Kalinowski committed Jul 11, 2023
2 parents efc9761 + 7bce53c commit 7e34637
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tools/idf_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -1198,7 +1198,7 @@ def save(self) -> None:
if global_idf_tools_path: # mypy fix for Optional[str] in the next call
# the directory doesn't exist if this is run on a clean system the first time
mkdir_p(global_idf_tools_path)
with open(idf_env_file_path, 'w') as w:
with open(idf_env_file_path, 'w', encoding='utf-8') as w:
info('Updating {}'.format(idf_env_file_path))
json.dump(dict(self), w, cls=IDFEnvEncoder, ensure_ascii=False, indent=4) # type: ignore
except (IOError, OSError):
Expand All @@ -1215,7 +1215,7 @@ def get_idf_env(cls): # type: () -> IDFEnv
idf_env_obj = cls()
try:
idf_env_file_path = os.path.join(global_idf_tools_path or '', IDF_ENV_FILE)
with open(idf_env_file_path, 'r') as idf_env_file:
with open(idf_env_file_path, 'r', encoding='utf-8') as idf_env_file:
idf_env_json = json.load(idf_env_file)

try:
Expand Down

0 comments on commit 7e34637

Please sign in to comment.