Author joernheissler
Recipients joernheissler, pitrou
Date 2019-08-06.09:35:50
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1565084150.95.0.74829896398.issue37773@roundup.psfhosted.org>
In-reply-to
Content
When running this code:

from zipfile import ZipFile
import io

def foo():
    pass

data = io.BytesIO()
zf = ZipFile(data, "w")


I get this message:

Exception ignored in: <function ZipFile.__del__ at 0x7f9005caa160>
Traceback (most recent call last):
  File "/home/user/git/oss/cpython/Lib/zipfile.py", line 1800, in __del__
  File "/home/user/git/oss/cpython/Lib/zipfile.py", line 1817, in close
ValueError: I/O operation on closed file.

Comment out def foo: pass, and there is no error.

It looks like the bug was introduced with commit ada319bb6d0ebcc68d3e0ef2b4279ea061877ac8 (bpo-32388).
History
Date User Action Args
2019-08-06 09:35:50joernheisslersetrecipients: + joernheissler, pitrou
2019-08-06 09:35:50joernheisslersetmessageid: <1565084150.95.0.74829896398.issue37773@roundup.psfhosted.org>
2019-08-06 09:35:50joernheisslerlinkissue37773 messages
2019-08-06 09:35:50joernheisslercreate