summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--unittests/allplatformstests.py2
-rw-r--r--unittests/baseplatformtests.py1
2 files changed, 2 insertions, 1 deletions
diff --git a/unittests/allplatformstests.py b/unittests/allplatformstests.py
index bfd0b1856..777f2f92a 100644
--- a/unittests/allplatformstests.py
+++ b/unittests/allplatformstests.py
@@ -471,7 +471,7 @@ class AllPlatformTests(BasePlatformTests):
# Ensure command output and JSON / text logs are not mangled.
raw_output_sample = '\x00\x01\x02\x03\x04\x05\x06\x07\x08\x0b'
assert raw_output_sample in tests_command_output
- text_log = Path(self.logdir, 'testlog.txt').read_text()
+ text_log = Path(self.logdir, 'testlog.txt').read_text(encoding='utf-8')
assert raw_output_sample in text_log
json_log = json.loads(Path(self.logdir, 'testlog.json').read_bytes())
assert raw_output_sample in json_log['stdout']
diff --git a/unittests/baseplatformtests.py b/unittests/baseplatformtests.py
index ec3f18908..6125ed933 100644
--- a/unittests/baseplatformtests.py
+++ b/unittests/baseplatformtests.py
@@ -85,6 +85,7 @@ class BasePlatformTests(TestCase):
# XCode backend is untested with unit tests, help welcome!
self.no_rebuild_stdout = [f'UNKNOWN BACKEND {self.backend.name!r}']
os.environ['COLUMNS'] = '80'
+ os.environ['PYTHONIOENCODING'] = 'utf8'
self.builddirs = []
self.new_builddir()