diff options
Diffstat (limited to 'Lib/test/test__xxsubinterpreters.py')
-rw-r--r-- | Lib/test/test__xxsubinterpreters.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Lib/test/test__xxsubinterpreters.py b/Lib/test/test__xxsubinterpreters.py index cf34fc3..7baea69 100644 --- a/Lib/test/test__xxsubinterpreters.py +++ b/Lib/test/test__xxsubinterpreters.py @@ -25,11 +25,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 _run_output(interp, request, shared=None): @@ -45,7 +45,7 @@ def _running(interp): def run(): interpreters.run_string(interp, dedent(f""" # wait for "signal" - with open({r}) as rpipe: + with open({r}, encoding="utf-8") as rpipe: rpipe.read() """)) @@ -54,7 +54,7 @@ def _running(interp): yield - with open(w, 'w') as spipe: + with open(w, 'w', encoding="utf-8") as spipe: spipe.write('done') t.join() @@ -806,7 +806,7 @@ class RunStringTests(TestBase): @unittest.skipUnless(hasattr(os, 'fork'), "test needs os.fork()") def test_fork(self): import tempfile - with tempfile.NamedTemporaryFile('w+') as file: + with tempfile.NamedTemporaryFile('w+', encoding="utf-8") as file: file.write('') file.flush() @@ -816,7 +816,7 @@ class RunStringTests(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}') """) interpreters.run_string(self.id, script) |