Skip to content

Commit 84105cb

Browse files
bpo-41401: Fix test_fspath_support in test_io. (pythonGH-21640) (pythonGH-22133) (pythonGH-22135)
The error is exposed on non-UTF-8 locales. (cherry picked from commit 67987ac) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com> (cherry picked from commit c73ee5a)
1 parent 4e581d6 commit 84105cb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Lib/test/test_io.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -922,7 +922,7 @@ def check_path_succeeds(path):
922922
self.assertEqual(f.read(), "egg\n")
923923

924924
check_path_succeeds(FakePath(support.TESTFN))
925-
check_path_succeeds(FakePath(support.TESTFN.encode('utf-8')))
925+
check_path_succeeds(FakePath(os.fsencode(support.TESTFN)))
926926

927927
with self.open(support.TESTFN, "w") as f:
928928
bad_path = FakePath(f.fileno())

0 commit comments

Comments
 (0)