From: Fred Drake Date: Wed, 28 Feb 2001 05:29:34 +0000 (+0000) Subject: Fix SF tracker bug #403871: AttributeError in ZipFile.__del__() when X-Git-Tag: v2.1b1~142 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=90eac285c8f0f0e7679d0b3bd85b3538240e8d1d;p=python Fix SF tracker bug #403871: AttributeError in ZipFile.__del__() when there was an IOError opening the underlying file in ZipFile.__init__(). --- diff --git a/Lib/zipfile.py b/Lib/zipfile.py index 1c2b0dee7f..2e5bfac55b 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: