diff options
Diffstat (limited to 'Lib/test/test_contextlib.py')
-rw-r--r-- | Lib/test/test_contextlib.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/test/test_contextlib.py b/Lib/test/test_contextlib.py index 50943c1a17e..453ef6c9f08 100644 --- a/Lib/test/test_contextlib.py +++ b/Lib/test/test_contextlib.py @@ -316,13 +316,13 @@ class FileContextTestCase(unittest.TestCase): tfn = tempfile.mktemp() try: f = None - with open(tfn, "w") as f: + with open(tfn, "w", encoding="utf-8") as f: self.assertFalse(f.closed) f.write("Booh\n") self.assertTrue(f.closed) f = None with self.assertRaises(ZeroDivisionError): - with open(tfn, "r") as f: + with open(tfn, "r", encoding="utf-8") as f: self.assertFalse(f.closed) self.assertEqual(f.read(), "Booh\n") 1 / 0 |