Issue #3187: Better support for "undecodable" filenames. Code by Victor

Stinner, with small tweaks by GvR.
This commit is contained in:
Guido van Rossum 2008-10-02 18:55:37 +00:00
parent fefeca53ee
commit f0af3e30db
11 changed files with 359 additions and 145 deletions

View file

@ -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)