mirror of
https://github.com/python/cpython.git
synced 2025-11-25 04:34:37 +00:00
Issue #3187: Better support for "undecodable" filenames. Code by Victor
Stinner, with small tweaks by GvR.
This commit is contained in:
parent
fefeca53ee
commit
f0af3e30db
11 changed files with 359 additions and 145 deletions
|
|
@ -90,7 +90,7 @@ class TestUnicodeFiles(unittest.TestCase):
|
|||
os.unlink(filename1 + ".new")
|
||||
|
||||
def _do_directory(self, make_name, chdir_name, encoded):
|
||||
cwd = os.getcwd()
|
||||
cwd = os.getcwdb()
|
||||
if os.path.isdir(make_name):
|
||||
os.rmdir(make_name)
|
||||
os.mkdir(make_name)
|
||||
|
|
@ -98,10 +98,10 @@ class TestUnicodeFiles(unittest.TestCase):
|
|||
os.chdir(chdir_name)
|
||||
try:
|
||||
if not encoded:
|
||||
cwd_result = os.getcwdu()
|
||||
cwd_result = os.getcwd()
|
||||
name_result = make_name
|
||||
else:
|
||||
cwd_result = os.getcwd().decode(TESTFN_ENCODING)
|
||||
cwd_result = os.getcwdb().decode(TESTFN_ENCODING)
|
||||
name_result = make_name.decode(TESTFN_ENCODING)
|
||||
|
||||
cwd_result = unicodedata.normalize("NFD", cwd_result)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue