Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 90eac28

Browse files
committed
Fix SF tracker bug #403871: AttributeError in ZipFile.__del__() when
there was an IOError opening the underlying file in ZipFile.__init__().
1 parent 3f571d6 commit 90eac28

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

Lib/zipfile.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,8 @@ def FileHeader(self):
9292
class ZipFile:
9393
"""Class with methods to open, read, write, close, list zip files."""
9494

95+
fp = None # Set here since __del__ checks it
96+
9597
def __init__(self, filename, mode="r", compression=ZIP_STORED):
9698
"""Open the ZIP file with mode read "r", write "w" or append "a"."""
9799
if compression == ZIP_STORED:

0 commit comments

Comments
 (0)