Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 96d7e83

Browse files
committed
Don't try to use a bytes sequence for file paths. Also force equivalency tests
to be between str8 and str.
1 parent 7a26534 commit 96d7e83

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

Lib/test/test_unicode_file.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
from test.test_support import run_unittest, TestSkipped, TESTFN_UNICODE
99
from test.test_support import TESTFN_ENCODING, TESTFN_UNICODE_UNENCODEABLE
1010
try:
11-
TESTFN_ENCODED = TESTFN_UNICODE.encode(TESTFN_ENCODING)
11+
TESTFN_ENCODED = TESTFN_UNICODE
12+
TESTFN_UNICODE.encode(TESTFN_ENCODING)
1213
except (UnicodeError, TypeError):
1314
# Either the file system encoding is None, or the file name
1415
# cannot be encoded in the file system encoding.
@@ -76,6 +77,7 @@ def _do_single(self, filename):
7677
# Do as many "equivalancy' tests as we can - ie, check that although we
7778
# have different types for the filename, they refer to the same file.
7879
def _do_equivilent(self, filename1, filename2):
80+
filename2 = str8(filename2)
7981
# Note we only check "filename1 against filename2" - we don't bother
8082
# checking "filename2 against 1", as we assume we are called again with
8183
# the args reversed.

0 commit comments

Comments
 (0)