diff options
Diffstat (limited to 'Lib/test/test_interpreters.py')
| -rw-r--r-- | Lib/test/test_interpreters.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/test/test_interpreters.py b/Lib/test/test_interpreters.py index 8d44d49..6266aa7 100644 --- a/Lib/test/test_interpreters.py +++ b/Lib/test/test_interpreters.py @@ -14,11 +14,11 @@ def _captured_script(script): indented = script.replace('\n', '\n ') wrapped = dedent(f""" import contextlib - with open({w}, 'w') as spipe: + with open({w}, 'w', encoding='utf-8') as spipe: with contextlib.redirect_stdout(spipe): {indented} """) - return wrapped, open(r) + return wrapped, open(r, encoding='utf-8') def clean_up_interpreters(): @@ -411,7 +411,7 @@ class TestInterpreterRun(TestBase): def test_fork(self): interp = interpreters.create() import tempfile - with tempfile.NamedTemporaryFile('w+') as file: + with tempfile.NamedTemporaryFile('w+', encoding='utf-8') as file: file.write('') file.flush() @@ -421,7 +421,7 @@ class TestInterpreterRun(TestBase): try: os.fork() except RuntimeError: - with open('{file.name}', 'w') as out: + with open('{file.name}', 'w', encoding='utf-8') as out: out.write('{expected}') """) interp.run(script) |
