]> granicus.if.org Git - python/commitdiff
Fixed the test of issue #13664 on platforms without unicode filenames support.
authorSerhiy Storchaka <storchaka@gmail.com>
Mon, 13 Oct 2014 07:33:32 +0000 (10:33 +0300)
committerSerhiy Storchaka <storchaka@gmail.com>
Mon, 13 Oct 2014 07:33:32 +0000 (10:33 +0300)
Lib/test/test_gzip.py

index 971306182e13dbde10c6b248bf2bf0a001ee3019..7f24981ed4c3e564d8fe5c5ff1bfe977fc365269 100644 (file)
@@ -33,6 +33,10 @@ class TestGzip(unittest.TestCase):
     @test_support.requires_unicode
     def test_unicode_filename(self):
         unicode_filename = test_support.TESTFN_UNICODE
+        try:
+            unicode_filename.encode(test_support.TESTFN_ENCODING)
+        except (UnicodeError, TypeError):
+            self.skipTest("Requires unicode filenames support")
         with gzip.GzipFile(unicode_filename, "wb") as f:
             f.write(data1 * 50)
         with gzip.GzipFile(unicode_filename, "rb") as f: