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 <1595585145.57.0.818818862354.issue41350@roundup.psfhosted.org>
In-reply-to
Content
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")
bytes_io.close()
zip_file.close()  # throws ValueError
History
Date User Action Args
2020-07-24 10:05:45Jeffrey.Kintschersetrecipients: + Jeffrey.Kintscher, jaraco, Nick Henderson
2020-07-24 10:05:45Jeffrey.Kintschersetmessageid: <1595585145.57.0.818818862354.issue41350@roundup.psfhosted.org>
2020-07-24 10:05:45Jeffrey.Kintscherlinkissue41350 messages
2020-07-24 10:05:45Jeffrey.Kintschercreate