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 bastian.ebeling
Recipients bastian.ebeling
Date 2020-08-26.07:31:31
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1598427092.16.0.16834501548.issue41640@roundup.psfhosted.org>
In-reply-to
Content
When trying to open an archive and read internal binary streams, for me it occurs, that the file-stream gets closed.
As a code-Snippet:

import zipfile
srcfile=zipfile.ZipFile('file.zip')
a=zipfile.Path(srcfile,"data1.bin").read_bytes()
b=zipfile.Path(srcfile,"data2.bin").read_bytes()

the second call results in the ValueError: seek of closed file

A quick and dirty solution (as an idea) is to change close() for the _SharedFile to run self.close() instead of self._close(findeobj) in the end (somehow around line 772).

Hopefully that helps
History
Date User Action Args
2020-08-26 07:31:32bastian.ebelingsetrecipients: + bastian.ebeling
2020-08-26 07:31:32bastian.ebelingsetmessageid: <1598427092.16.0.16834501548.issue41640@roundup.psfhosted.org>
2020-08-26 07:31:32bastian.ebelinglinkissue41640 messages
2020-08-26 07:31:31bastian.ebelingcreate