From: Victor Stinner Date: Mon, 30 Mar 2015 00:20:37 +0000 (+0200) Subject: Issue #22390: Fix test_gzip if unicode filename doesn't work X-Git-Tag: v2.7.10rc1~93 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7d490650fb01788212259bdea51fe3b106879299;p=thirdparty%2FPython%2Fcpython.git Issue #22390: Fix test_gzip if unicode filename doesn't work --- diff --git a/Lib/test/test_gzip.py b/Lib/test/test_gzip.py index 95f51411a104..5025b91d343a 100644 --- a/Lib/test/test_gzip.py +++ b/Lib/test/test_gzip.py @@ -41,11 +41,11 @@ class TestGzip(unittest.TestCase): @test_support.requires_unicode def test_unicode_filename(self): unicode_filename = test_support.TESTFN_UNICODE - self.filename = unicode_filename try: unicode_filename.encode(test_support.TESTFN_ENCODING) except (UnicodeError, TypeError): self.skipTest("Requires unicode filenames support") + self.filename = unicode_filename with gzip.GzipFile(unicode_filename, "wb") as f: f.write(data1 * 50) with gzip.GzipFile(unicode_filename, "rb") as f: