This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Jeffrey.Kintscher
Recipients Jeffrey.Kintscher, Nick Henderson, jaraco
Date 2020-07-24.10:05:45
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
I created a simpler test case that exercises the buggy code.  The problem can be reproduced by passing ZipFile.__init__() a file-like object with the write flag (mode "w") and then closing the file-like object before calling ZipFile.close().

The exception being triggered by the call to ZipFile.__del__() is a side-effect because all ZipFile.__del__() does is call ZipFile.close().

import io
from zipfile import ZipFile

bytes_io = io.BytesIO()
zip_file = ZipFile(bytes_io, mode="w")
zip_file.close()  # throws ValueError
Date User Action Args
2020-07-24 10:05:45Jeffrey.Kintschersetrecipients: + Jeffrey.Kintscher, jaraco, Nick Henderson
2020-07-24 10:05:45Jeffrey.Kintschersetmessageid: <>
2020-07-24 10:05:45Jeffrey.Kintscherlinkissue41350 messages
2020-07-24 10:05:45Jeffrey.Kintschercreate