[Python-checkins] cpython (2.7): Fixed the test of issue #13664 on platforms without unicode filenames support.

serhiy.storchaka python-checkins at python.org
Mon Oct 13 09:34:53 CEST 2014


https://hg.python.org/cpython/rev/7657cc08d29b
changeset:   93022:7657cc08d29b
branch:      2.7
parent:      93018:a4c1c9b534a2
user:        Serhiy Storchaka <storchaka at gmail.com>
date:        Mon Oct 13 10:33:32 2014 +0300
summary:
  Fixed the test of issue #13664 on platforms without unicode filenames support.

files:
  Lib/test/test_gzip.py |  4 ++++
  1 files changed, 4 insertions(+), 0 deletions(-)


diff --git a/Lib/test/test_gzip.py b/Lib/test/test_gzip.py
--- a/Lib/test/test_gzip.py
+++ b/Lib/test/test_gzip.py
@@ -33,6 +33,10 @@
     @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:

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list