Skip to content

Commit

Permalink
bpo-41401: Fix test_fspath_support in test_io. (GH-21640) (GH-22133)
Browse files Browse the repository at this point in the history
The error is exposed on non-UTF-8 locales.

(cherry picked from commit 67987ac)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
  • Loading branch information
vstinner and serhiy-storchaka committed Sep 7, 2020
1 parent b6d2acb commit c73ee5a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Lib/test/test_io.py
Expand Up @@ -924,7 +924,7 @@ def check_path_succeeds(path):
self.assertEqual(f.read(), "egg\n")

check_path_succeeds(FakePath(support.TESTFN))
check_path_succeeds(FakePath(support.TESTFN.encode('utf-8')))
check_path_succeeds(FakePath(os.fsencode(support.TESTFN)))

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

0 comments on commit c73ee5a

Please sign in to comment.