Author joernheissler
Recipients joernheissler, pitrou
Date 2019-08-06.09:35:50
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
When running this code:

from zipfile import ZipFile
import io

def foo():

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/", line 1800, in __del__
  File "/home/user/git/oss/cpython/Lib/", 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).
Date User Action Args
2019-08-06 09:35:50joernheisslersetrecipients: + joernheissler, pitrou
2019-08-06 09:35:50joernheisslersetmessageid: <>
2019-08-06 09:35:50joernheisslerlinkissue37773 messages
2019-08-06 09:35:50joernheisslercreate