Kaydet (Commit) 7d490650 authored tarafından Victor Stinner's avatar Victor Stinner

Issue #22390: Fix test_gzip if unicode filename doesn't work

üst 7b00364e
...@@ -41,11 +41,11 @@ class TestGzip(unittest.TestCase): ...@@ -41,11 +41,11 @@ class TestGzip(unittest.TestCase):
@test_support.requires_unicode @test_support.requires_unicode
def test_unicode_filename(self): def test_unicode_filename(self):
unicode_filename = test_support.TESTFN_UNICODE unicode_filename = test_support.TESTFN_UNICODE
self.filename = unicode_filename
try: try:
unicode_filename.encode(test_support.TESTFN_ENCODING) unicode_filename.encode(test_support.TESTFN_ENCODING)
except (UnicodeError, TypeError): except (UnicodeError, TypeError):
self.skipTest("Requires unicode filenames support") self.skipTest("Requires unicode filenames support")
self.filename = unicode_filename
with gzip.GzipFile(unicode_filename, "wb") as f: with gzip.GzipFile(unicode_filename, "wb") as f:
f.write(data1 * 50) f.write(data1 * 50)
with gzip.GzipFile(unicode_filename, "rb") as f: with gzip.GzipFile(unicode_filename, "rb") as f:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment