diff options
author | Georg Brandl <georg@python.org> | 2011-01-01 10:42:31 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2011-01-01 10:42:31 (GMT) |
commit | 04480a8ae54f313f9b74dd5bc2007f6b5d8e6b94 (patch) | |
tree | 1dce8611d1f77b542a947d8f7714bd9eee7a7eee /Lib/test/test_zipfile.py | |
parent | 5ba11de8454b7dbc1cf260911a2628608267a50c (diff) | |
download | cpython-04480a8ae54f313f9b74dd5bc2007f6b5d8e6b94.zip cpython-04480a8ae54f313f9b74dd5bc2007f6b5d8e6b94.tar.gz cpython-04480a8ae54f313f9b74dd5bc2007f6b5d8e6b94.tar.bz2 |
#10801: do not actually extract, just open() the files in the test zipfile.
Diffstat (limited to 'Lib/test/test_zipfile.py')
-rw-r--r-- | Lib/test/test_zipfile.py | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/Lib/test/test_zipfile.py b/Lib/test/test_zipfile.py index e8aec4f..8d51528 100644 --- a/Lib/test/test_zipfile.py +++ b/Lib/test/test_zipfile.py @@ -490,16 +490,11 @@ class TestsWithSourceFile(unittest.TestCase): self.assertTrue(zipfp2.fp is None, 'zipfp is not closed') def test_unicode_filenames(self): - if __name__ == '__main__': - myfile = sys.argv[0] - else: - myfile = __file__ - - mydir = os.path.dirname(myfile) or os.curdir - fname = os.path.join(mydir, 'zip_cp437_header.zip') - + # bug #10801 + fname = findfile('zip_cp437_header.zip') with zipfile.ZipFile(fname) as zipfp: - zipfp.extractall() + for name in zipfp.namelist(): + zipfp.open(name).close() def tearDown(self): unlink(TESTFN) |