diff options
| author | dimdim11 <[email protected]> | 2024-07-11 22:43:26 +0300 |
|---|---|---|
| committer | dimdim11 <[email protected]> | 2024-07-11 22:57:47 +0300 |
| commit | bd17d6089c7825d1d418ccfcab54e95e3e2a464c (patch) | |
| tree | 44f170326320ac3aed63d8ed65a28a5468142f7d | |
| parent | b9f9cd42cc71d5fbb6c975a9fe34131988547b78 (diff) | |
Set utf-8 encoding for read/write in vcs_info.py
Set utf-8 encoding for read/write in export scripts
88d1ac61b0f29800dc727cb95fa69e734b0c4b17
| -rw-r--r-- | build/scripts/vcs_info.py | 14 | ||||
| -rw-r--r-- | build/ymake.core.conf | 2 |
2 files changed, 8 insertions, 8 deletions
diff --git a/build/scripts/vcs_info.py b/build/scripts/vcs_info.py index fd1f6b3c502..ce28705f08c 100644 --- a/build/scripts/vcs_info.py +++ b/build/scripts/vcs_info.py @@ -88,7 +88,7 @@ def get_default_json(): def get_json(file_name): try: - with open(file_name, 'r') as f: + with open(file_name, 'rt', encoding="utf-8") as f: out = json.load(f) # TODO: check 'tar+svn' parsing @@ -110,9 +110,9 @@ def print_c(json_file, output_file, argv): $(SOURCE_ROOT)/build/scripts/c_templates/svn_interface.c""" interface = argv[0] - with open(interface) as c: + with open(interface, 'rt', encoding="utf-8") as c: c_file = c.read() - with open(output_file, 'w') as f: + with open(output_file, 'wt', encoding="utf-8") as f: header = '\n'.join(_Formatting.escaped_define(k, v) for k, v in json_file.items()) f.write(header + '\n' + c_file) @@ -178,10 +178,10 @@ def merge_java_mf_dir(json_file, out_manifest, input_dir): old_lines = [] if os.path.isfile(manifest): - with open(manifest, 'r') as f: + with open(manifest, 'rt', encoding="utf-8") as f: old_lines = f.readlines() - with open(out_manifest, 'w') as f: + with open(out_manifest, 'wt', encoding="utf-8") as f: f.write(merge_java_content(old_lines, json_file)) @@ -248,7 +248,7 @@ def print_go(json_file, output_file, arc_project_prefix): lines.append(_Formatting.escaped_go_map_key(k, v)) return lines - with open(output_file, 'w') as f: + with open(output_file, 'wt', encoding="utf-8") as f: f.write( '\n'.join( [ @@ -310,7 +310,7 @@ def print_json(json_file, output_file): if k in json_file and json_file[k]: ext_json[OPTIONAL_FIELDS_MAP[k]] = json_file[k] - with open(output_file, 'w') as f: + with open(output_file, 'wt', encoding="utf-8") as f: json.dump(ext_json, f, sort_keys=True, indent=4) diff --git a/build/ymake.core.conf b/build/ymake.core.conf index 03b940f50f2..dbf21b492ed 100644 --- a/build/ymake.core.conf +++ b/build/ymake.core.conf @@ -4010,7 +4010,7 @@ when ($FORCE_VCS_INFO_UPDATE == "yes") { ### Works for pyton too. GENERATE_VCS_C_INFO_NODEP=$YMAKE_PYTHON3 ${input:"build/scripts/vcs_info.py"} $(VCS)/vcs.json $VCS_C ${input:"build/scripts/c_templates/svn_interface.c"} $VCS_INFO_DISABLE_CACHE__NO_UID__ && $_SRC_c_nodeps($VCS_C, $VCS_C_OBJ, $(SOURCE_ROOT)) GENERATE_VCS_GO_INFO_NODEP=$YMAKE_PYTHON3 ${input:"build/scripts/vcs_info.py"} output-go $(VCS)/vcs.json $VCS_GO $GO_ARCADIA_PROJECT_PREFIX $VCS_INFO_DISABLE_CACHE__NO_UID__ -GENERATE_VCS_JAVA_INFO_NODEP=$YMAKE_PYTHON ${input:"build/scripts/vcs_info.py"} output-java $(VCS)/vcs.json $VCS_JAVA $VCS_INFO_DISABLE_CACHE__NO_UID__ +GENERATE_VCS_JAVA_INFO_NODEP=$YMAKE_PYTHON3 ${input:"build/scripts/vcs_info.py"} output-java $(VCS)/vcs.json $VCS_JAVA $VCS_INFO_DISABLE_CACHE__NO_UID__ macro UPDATE_VCS_JAVA_INFO_NODEP(Jar) { .CMD=$YMAKE_PYTHON3 ${input:"build/scripts/vcs_info.py"} output-java $(VCS)/vcs.json $VCS_JAVA $Jar $VCS_INFO_DISABLE_CACHE__NO_UID__ } |
