diff options
author | Tristan Partin <tristan@partin.io> | 2023-07-12 14:10:08 -0500 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2023-07-13 09:55:10 -0700 |
commit | 3784f729731c6fd1aacc6e9fe26f9a7e363c56b1 (patch) | |
tree | 8e420867193064c0b6e87eee70bd90f7d8c9068d /unittests/machinefiletests.py | |
parent | bd3d2cf91894b1f91128011b2cf56a5bd2c326ae (diff) | |
download | meson-3784f729731c6fd1aacc6e9fe26f9a7e363c56b1.zip meson-3784f729731c6fd1aacc6e9fe26f9a7e363c56b1.tar.gz meson-3784f729731c6fd1aacc6e9fe26f9a7e363c56b1.tar.bz2 |
Silence some encoding warnings
By specifiying explicit encodings, we can silence warnings like:
/__w/meson/meson/test cases/common/100 postconf with args/postconf.py:15: EncodingWarning: 'encoding' argument not specified
with open(input_file) as f:
in CI.
Diffstat (limited to 'unittests/machinefiletests.py')
-rw-r--r-- | unittests/machinefiletests.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/unittests/machinefiletests.py b/unittests/machinefiletests.py index 3807c88..9e71810 100644 --- a/unittests/machinefiletests.py +++ b/unittests/machinefiletests.py @@ -754,7 +754,7 @@ class CrossFileTests(BasePlatformTests): with tempfile.TemporaryDirectory() as d: dir_ = os.path.join(d, 'meson', 'cross') os.makedirs(dir_) - with tempfile.NamedTemporaryFile('w', dir=dir_, delete=False) as f: + with tempfile.NamedTemporaryFile('w', dir=dir_, delete=False, encoding='utf-8') as f: f.write(cross_content) name = os.path.basename(f.name) @@ -770,7 +770,7 @@ class CrossFileTests(BasePlatformTests): with tempfile.TemporaryDirectory() as d: dir_ = os.path.join(d, '.local', 'share', 'meson', 'cross') os.makedirs(dir_) - with tempfile.NamedTemporaryFile('w', dir=dir_, delete=False) as f: + with tempfile.NamedTemporaryFile('w', dir=dir_, delete=False, encoding='utf-8') as f: f.write(cross_content) name = os.path.basename(f.name) |