diff options
| author | Victor Stinner <vstinner@python.org> | 2020-09-07 16:45:57 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-09-07 16:45:57 +0200 |
| commit | c73ee5acc96b4bbd6885156883b224b8cc3e470c (patch) | |
| tree | 6b4a5fd55a2d728f2426919090841b5694ebeac8 | |
| parent | b6d2acb1b1a21f857c17cfb6e0e97a7b8bdc0171 (diff) | |
| download | cpython-git-c73ee5acc96b4bbd6885156883b224b8cc3e470c.tar.gz | |
bpo-41401: Fix test_fspath_support in test_io. (GH-21640) (GH-22133)
The error is exposed on non-UTF-8 locales.
(cherry picked from commit 67987acd5dc9776f55f4e139e2b3d9e7a6434d9f)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
| -rw-r--r-- | Lib/test/test_io.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/test/test_io.py b/Lib/test/test_io.py index fe07b56880..d2e387728b 100644 --- a/Lib/test/test_io.py +++ b/Lib/test/test_io.py @@ -924,7 +924,7 @@ class IOTest(unittest.TestCase): 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()) |
