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 martin.panter
Recipients Ellison Marks, Jeremy Heiner, martin.panter, serhiy.storchaka, takluyver, xiang.zhang
Date 2017-04-08.01:22:59
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
It looks like the zip entry writer object may not expect its “close” method to be called multiple times. Other file objects tend to allow this with no ill effect. Adding Serhiy and Thomas who implemented the writer object in Issue 26039.

The first time it is called will be when the context manager (“with” statement) exits.

The second time will be when the TextIOWrapper is garbage-collected. This is documented behaviour <>, but I think it is a design mistake of the IOBase hierarchy; see Issue 19829.

A reasonable workaround would be to call encoder.detach() after you have finished writing the zip entry.
Date User Action Args
2017-04-08 01:23:00martin.pantersetrecipients: + martin.panter, takluyver, serhiy.storchaka, xiang.zhang, Ellison Marks, Jeremy Heiner
2017-04-08 01:23:00martin.pantersetmessageid: <>
2017-04-08 01:23:00martin.panterlinkissue30017 messages
2017-04-08 01:22:59martin.pantercreate