diff -r 0eeb39fc8ff5 Lib/test/test_zipfile64.py --- a/Lib/test/test_zipfile64.py Tue Dec 01 19:59:53 2015 +1100 +++ b/Lib/test/test_zipfile64.py Sat Dec 05 10:01:03 2015 +0100 @@ -72,15 +72,17 @@ def testStored(self): # Try the temp file first. If we do TESTFN2 first, then it hogs # gigabytes of disk space for the duration of the test. - for f in TemporaryFile(), TESTFN2: + with TemporaryFile() as f: self.zipTest(f, zipfile.ZIP_STORED) + self.zipTest(TESTFN2, zipfile.ZIP_STORED) @requires_zlib def testDeflated(self): # Try the temp file first. If we do TESTFN2 first, then it hogs # gigabytes of disk space for the duration of the test. - for f in TemporaryFile(), TESTFN2: + with TemporaryFile() as f: self.zipTest(f, zipfile.ZIP_DEFLATED) + self.zipTest(TESTFN2, zipfile.ZIP_DEFLATED) def tearDown(self): for fname in TESTFN, TESTFN2: