From 3e396b3782813d36d46195564cd0e111422bcaf5 Mon Sep 17 00:00:00 2001 From: Daniel Mensinger Date: Tue, 22 Jun 2021 22:59:16 +0200 Subject: fix: Always explicitly set encoding for text files (fixes #8263) --- ci/ciimage/build.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'ci/ciimage') diff --git a/ci/ciimage/build.py b/ci/ciimage/build.py index dcc11a979..2cf07361c 100755 --- a/ci/ciimage/build.py +++ b/ci/ciimage/build.py @@ -18,7 +18,7 @@ install_script = 'install.sh' class ImageDef: def __init__(self, image_dir: Path) -> None: path = image_dir / image_def_file - data = json.loads(path.read_text()) + data = json.loads(path.read_text(encoding='utf-8')) assert isinstance(data, dict) assert all([x in data for x in ['base_image', 'env']]) @@ -74,7 +74,7 @@ class Builder(BuilderBase): # Also add /ci to PATH out_data += 'export PATH="/ci:$PATH"\n' - out_file.write_text(out_data) + out_file.write_text(out_data, encoding='utf-8') # make it executable mode = out_file.stat().st_mode @@ -91,7 +91,7 @@ class Builder(BuilderBase): RUN /ci/install.sh ''') - out_file.write_text(out_data) + out_file.write_text(out_data, encoding='utf-8') def do_build(self) -> None: # copy files @@ -131,7 +131,7 @@ class ImageTester(BuilderBase): ADD meson /meson ''') - out_file.write_text(out_data) + out_file.write_text(out_data, encoding='utf-8') def copy_meson(self) -> None: shutil.copytree( -- cgit v1.2.3