summaryrefslogtreecommitdiff
path: root/Lib/test/test_io.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2020-07-27 20:58:35 +0300
committerGitHub <noreply@github.com>2020-07-27 20:58:35 +0300
commit67987acd5dc9776f55f4e139e2b3d9e7a6434d9f (patch)
treedcd7434c6abef096638562294a58d184ce153271 /Lib/test/test_io.py
parent855e68855eeb06f8f0319b3366d3a012c2ff2041 (diff)
downloadcpython-git-67987acd5dc9776f55f4e139e2b3d9e7a6434d9f.tar.gz
bpo-41401: Fix test_fspath_support in test_io. (GH-21640)
The error is exposed on non-UTF-8 locales.
Diffstat (limited to 'Lib/test/test_io.py')
-rw-r--r--Lib/test/test_io.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/test/test_io.py b/Lib/test/test_io.py
index 18b8a79416..85fac30e30 100644
--- a/Lib/test/test_io.py
+++ b/Lib/test/test_io.py
@@ -928,7 +928,7 @@ class IOTest(unittest.TestCase):
self.assertEqual(f.read(), "egg\n")
check_path_succeeds(FakePath(os_helper.TESTFN))
- check_path_succeeds(FakePath(os_helper.TESTFN.encode('utf-8')))
+ check_path_succeeds(FakePath(os.fsencode(os_helper.TESTFN)))
with self.open(os_helper.TESTFN, "w") as f:
bad_path = FakePath(f.fileno())