diff options
author | dimdim11 <dimdim11@yandex-team.com> | 2024-04-24 00:17:05 +0300 |
---|---|---|
committer | dimdim11 <dimdim11@yandex-team.com> | 2024-04-24 00:25:29 +0300 |
commit | 3baa9aa967a153ef389ee853f79fab5dfb4a184a (patch) | |
tree | 769210a3b6766012ccf0b31b0b138cfc34909397 /build | |
parent | 0add7c67fec9cfc75d74ebf9dfba10202cc65360 (diff) | |
download | ydb-3baa9aa967a153ef389ee853f79fab5dfb4a184a.tar.gz |
Add encoding utf-8 for reading/writing files
Add encoding utf-8 for reading/writing files
12a3ca5bf28ac486a2897fd6cdf155b0bf049483
Diffstat (limited to 'build')
-rw-r--r-- | build/scripts/cpp_proto_wrapper.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/build/scripts/cpp_proto_wrapper.py b/build/scripts/cpp_proto_wrapper.py index 8cc4ccc1be..aa4f6588b1 100644 --- a/build/scripts/cpp_proto_wrapper.py +++ b/build/scripts/cpp_proto_wrapper.py @@ -5,7 +5,7 @@ import re import argparse -FROM_RE = re.compile("((?:struct|class)\s+\S+\s+)final\s*:") +FROM_RE = re.compile(u"((?:struct|class)\s+\S+\s+)final\s*:") TO_RE = "\\1:" @@ -30,10 +30,10 @@ def main(namespace: argparse.Namespace) -> int: return e.returncode for output in namespace.outputs: - with open(output, 'r') as f: + with open(output, 'rt', encoding="utf-8") as f: patched_text, num_patches = patch_proto_file(f.read()) if num_patches: - with open(output, 'w') as f: + with open(output, 'wt', encoding="utf-8") as f: f.write(patched_text) return 0 |