From 90eac285c8f0f0e7679d0b3bd85b3538240e8d1d Mon Sep 17 00:00:00 2001 From: Fred Drake Date: Wed, 28 Feb 2001 05:29:34 +0000 Subject: [PATCH] Fix SF tracker bug #403871: AttributeError in ZipFile.__del__() when there was an IOError opening the underlying file in ZipFile.__init__(). --- Lib/zipfile.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Lib/zipfile.py b/Lib/zipfile.py index 1c2b0dee7f8..2e5bfac55b1 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: