diff -r 66731a1b1aa4 Lib/test/test_zipfile.py --- a/Lib/test/test_zipfile.py Wed Apr 17 19:15:52 2013 +0100 +++ b/Lib/test/test_zipfile.py Sun Apr 21 00:14:19 2013 +0300 @@ -18,7 +18,15 @@ from random import randint, random from unittest import skipUnless -from test.test_support import TESTFN, TESTFN_UNICODE, run_unittest, findfile, unlink +from test.test_support import TESTFN, TESTFN_UNICODE, TESTFN_ENCODING, \ + run_unittest, findfile, unlink +try: + TESTFN_UNICODE.encode(TESTFN_ENCODING) +except (UnicodeError, TypeError): + # Either the file system encoding is None, or the file name + # cannot be encoded in the file system encoding. + TESTFN_UNICODE = None + raise unittest.SkipTest("No Unicode filesystem semantics on this platform.") TESTFN2 = TESTFN + "2" TESTFNDIR = TESTFN + "d" @@ -424,6 +432,7 @@ with open(filename, 'rb') as f: self.assertEqual(f.read(), content) + @skipUnless(TESTFN_UNICODE, "No Unicode filesystem semantics on this platform.") def test_extract_unicode_filenames(self): fnames = [u'foo.txt', os.path.basename(TESTFN_UNICODE)] content = 'Test for unicode filename'