Always open text file for write with UTF-8 (#3688)

### What problem does this PR solve?

Always open text file for write with UTF-8. Close #932 

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
Zhichang Yu
2024-11-27 16:24:16 +08:00
committed by GitHub
parent 6fb1a181aa
commit 2249d5d413
5 changed files with 11 additions and 8 deletions

View File

@ -146,7 +146,7 @@ def rewrite_yaml_conf(conf_path, config):
def rewrite_json_file(filepath, json_data):
with open(filepath, "w") as f:
with open(filepath, "w", encoding='utf-8') as f:
json.dump(json_data, f, indent=4, separators=(",", ": "))
f.close()