summaryrefslogtreecommitdiffstats
path: root/Lib/zipfile.py
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2001-02-28 05:29:34 (GMT)
committerFred Drake <fdrake@acm.org>2001-02-28 05:29:34 (GMT)
commit90eac285c8f0f0e7679d0b3bd85b3538240e8d1d (patch)
tree13420965a0194f6ee869baeb97069dbad5516d20 /Lib/zipfile.py
parent3f571d6497f33945da5ea7791fc533df1f995387 (diff)
downloadcpython-90eac285c8f0f0e7679d0b3bd85b3538240e8d1d.zip
cpython-90eac285c8f0f0e7679d0b3bd85b3538240e8d1d.tar.gz
cpython-90eac285c8f0f0e7679d0b3bd85b3538240e8d1d.tar.bz2
Fix SF tracker bug #403871: AttributeError in ZipFile.__del__() when
there was an IOError opening the underlying file in ZipFile.__init__().
Diffstat (limited to 'Lib/zipfile.py')
-rw-r--r--Lib/zipfile.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/zipfile.py b/Lib/zipfile.py
index 1c2b0de..2e5bfac 100644
--- a/Lib/zipfile.py
+++ b/Lib/zipfile.py
@@ -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: