mirror of
https://github.com/python/cpython.git
synced 2025-09-27 10:50:04 +00:00
#10801: do not actually extract, just open() the files in the test zipfile.
This commit is contained in:
parent
5ba11de845
commit
04480a8ae5
1 changed files with 4 additions and 9 deletions
|
@ -490,16 +490,11 @@ class TestsWithSourceFile(unittest.TestCase):
|
||||||
self.assertTrue(zipfp2.fp is None, 'zipfp is not closed')
|
self.assertTrue(zipfp2.fp is None, 'zipfp is not closed')
|
||||||
|
|
||||||
def test_unicode_filenames(self):
|
def test_unicode_filenames(self):
|
||||||
if __name__ == '__main__':
|
# bug #10801
|
||||||
myfile = sys.argv[0]
|
fname = findfile('zip_cp437_header.zip')
|
||||||
else:
|
|
||||||
myfile = __file__
|
|
||||||
|
|
||||||
mydir = os.path.dirname(myfile) or os.curdir
|
|
||||||
fname = os.path.join(mydir, 'zip_cp437_header.zip')
|
|
||||||
|
|
||||||
with zipfile.ZipFile(fname) as zipfp:
|
with zipfile.ZipFile(fname) as zipfp:
|
||||||
zipfp.extractall()
|
for name in zipfp.namelist():
|
||||||
|
zipfp.open(name).close()
|
||||||
|
|
||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
unlink(TESTFN)
|
unlink(TESTFN)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue