Skip to content

Commit 67987ac

Browse files
bpo-41401: Fix test_fspath_support in test_io. (GH-21640)
The error is exposed on non-UTF-8 locales.
1 parent 855e688 commit 67987ac

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
@@ -928,7 +928,7 @@ def check_path_succeeds(path):
928928
self.assertEqual(f.read(), "egg\n")
929929

930930
check_path_succeeds(FakePath(os_helper.TESTFN))
931-
check_path_succeeds(FakePath(os_helper.TESTFN.encode('utf-8')))
931+
check_path_succeeds(FakePath(os.fsencode(os_helper.TESTFN)))
932932

933933
with self.open(os_helper.TESTFN, "w") as f:
934934
bad_path = FakePath(f.fileno())

0 commit comments

Comments
 (0)