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 /test cases | |
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 'test cases')
-rw-r--r-- | test cases/common/100 postconf with args/postconf.py | 4 | ||||
-rw-r--r-- | test cases/common/99 postconf/postconf.py | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/test cases/common/100 postconf with args/postconf.py b/test cases/common/100 postconf with args/postconf.py index cef7f79..af6abe4 100644 --- a/test cases/common/100 postconf with args/postconf.py +++ b/test cases/common/100 postconf with args/postconf.py @@ -12,7 +12,7 @@ template = '''#pragma once input_file = os.path.join(os.environ['MESON_SOURCE_ROOT'], 'raw.dat') output_file = os.path.join(os.environ['MESON_BUILD_ROOT'], 'generated.h') -with open(input_file) as f: +with open(input_file, encoding='utf-8') as f: data = f.readline().strip() -with open(output_file, 'w') as f: +with open(output_file, 'w', encoding='utf-8') as f: f.write(template.format(data, sys.argv[1], sys.argv[2])) diff --git a/test cases/common/99 postconf/postconf.py b/test cases/common/99 postconf/postconf.py index 950c706..8cf576c 100644 --- a/test cases/common/99 postconf/postconf.py +++ b/test cases/common/99 postconf/postconf.py @@ -10,7 +10,7 @@ template = '''#pragma once input_file = os.path.join(os.environ['MESON_SOURCE_ROOT'], 'raw.dat') output_file = os.path.join(os.environ['MESON_BUILD_ROOT'], 'generated.h') -with open(input_file) as f: +with open(input_file, encoding='utf-8') as f: data = f.readline().strip() -with open(output_file, 'w') as f: +with open(output_file, 'w', encoding='utf-8') as f: f.write(template.format(data)) |