]> granicus.if.org Git - python/commitdiff
Fix SF tracker bug #403871: AttributeError in ZipFile.__del__() when
authorFred Drake <fdrake@acm.org>
Wed, 28 Feb 2001 05:29:34 +0000 (05:29 +0000)
committerFred Drake <fdrake@acm.org>
Wed, 28 Feb 2001 05:29:34 +0000 (05:29 +0000)
    there was an IOError opening the underlying file in ZipFile.__init__().

Lib/zipfile.py

index 1c2b0dee7f86695d4d82e4685ae10e53834f2175..2e5bfac55b12f6d3298a3d61b34c261a0f4341fa 100644 (file)
@@ -92,6 +92,8 @@ class ZipInfo:
 class ZipFile:
     """Class with methods to open, read, write, close, list zip files."""
 
+    fp = None                   # Set here since __del__ checks it
+
     def __init__(self, filename, mode="r", compression=ZIP_STORED):
         """Open the ZIP file with mode read "r", write "w" or append "a"."""
         if compression == ZIP_STORED: