From ef858d3f4284eb6d421d4fe5cf7f75d8fdb7534b Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Mon, 27 Jul 2020 20:58:35 +0300 Subject: [PATCH] bpo-41401: Fix test_fspath_support in test_io. (GH-21640) The error is exposed on non-UTF-8 locales. (cherry picked from commit 67987acd5dc9776f55f4e139e2b3d9e7a6434d9f) --- Lib/test/test_io.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/test/test_io.py b/Lib/test/test_io.py index fe07b56880bbfb..d2e387728bd5f5 100644 --- a/Lib/test/test_io.py +++ b/Lib/test/test_io.py @@ -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())