diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2021-06-29 20:52:55 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-29 20:52:55 +0300 |
commit | 4bfee181c5a166e3d429bd265e06d299dce50f30 (patch) | |
tree | 8918a0e09f668ed55748ec254c51b4d92b5403a9 /mesonbuild/mintro.py | |
parent | 81ca0ec7ae975723b8b399b9f142286895a45dab (diff) | |
parent | c0a2025d038a08092212bfc45e7bbb46ff1e8e52 (diff) | |
download | meson-4bfee181c5a166e3d429bd265e06d299dce50f30.zip meson-4bfee181c5a166e3d429bd265e06d299dce50f30.tar.gz meson-4bfee181c5a166e3d429bd265e06d299dce50f30.tar.bz2 |
Merge pull request #8918 from mensinda/pathlibFixes
pathlib: Patch pathlib to work around some bugs (fixes #8263 #7295)
Diffstat (limited to 'mesonbuild/mintro.py')
-rw-r--r-- | mesonbuild/mintro.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/mesonbuild/mintro.py b/mesonbuild/mintro.py index 430b2f1..73790a5 100644 --- a/mesonbuild/mintro.py +++ b/mesonbuild/mintro.py @@ -394,7 +394,7 @@ def get_info_file(infodir: str, kind: T.Optional[str] = None) -> str: 'meson-info.json' if not kind else f'intro-{kind}.json') def load_info_file(infodir: str, kind: T.Optional[str] = None) -> T.Any: - with open(get_info_file(infodir, kind)) as fp: + with open(get_info_file(infodir, kind), encoding='utf-8') as fp: return json.load(fp) def run(options: argparse.Namespace) -> int: @@ -464,7 +464,7 @@ def write_intro_info(intro_info: T.Sequence[T.Tuple[str, T.Union[dict, T.List[T. for i in intro_info: out_file = os.path.join(info_dir, 'intro-{}.json'.format(i[0])) tmp_file = os.path.join(info_dir, 'tmp_dump.json') - with open(tmp_file, 'w') as fp: + with open(tmp_file, 'w', encoding='utf-8') as fp: json.dump(i[1], fp) fp.flush() # Not sure if this is needed os.replace(tmp_file, out_file) @@ -535,7 +535,7 @@ def write_meson_info_file(builddata: build.Build, errors: list, build_files_upda # Write the data to disc tmp_file = os.path.join(info_dir, 'tmp_dump.json') - with open(tmp_file, 'w') as fp: + with open(tmp_file, 'w', encoding='utf-8') as fp: json.dump(info_data, fp) fp.flush() os.replace(tmp_file, info_file) |