summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_cmd_line.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_cmd_line.py')
-rw-r--r--Lib/test/test_cmd_line.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/test/test_cmd_line.py b/Lib/test/test_cmd_line.py
index 25d3eec..3758767 100644
--- a/Lib/test/test_cmd_line.py
+++ b/Lib/test/test_cmd_line.py
@@ -512,7 +512,7 @@ class CmdLineTest(unittest.TestCase):
# the dict whereas the module was destroyed
filename = os_helper.TESTFN
self.addCleanup(os_helper.unlink, filename)
- with open(filename, "w") as script:
+ with open(filename, "w", encoding="utf-8") as script:
print("import sys", file=script)
print("del sys.modules['__main__']", file=script)
assert_python_ok(filename)
@@ -549,9 +549,9 @@ class CmdLineTest(unittest.TestCase):
with os_helper.temp_cwd() as tmpdir:
fake = os.path.join(tmpdir, "uuid.py")
main = os.path.join(tmpdir, "main.py")
- with open(fake, "w") as f:
+ with open(fake, "w", encoding="utf-8") as f:
f.write("raise RuntimeError('isolated mode test')\n")
- with open(main, "w") as f:
+ with open(main, "w", encoding="utf-8") as f:
f.write("import uuid\n")
f.write("print('ok')\n")
self.assertRaises(subprocess.CalledProcessError,