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 ammar2
Recipients ammar2, zhangxp1998
Date 2021-10-06.15:22:47
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1633533767.42.0.957065093298.issue45006@roundup.psfhosted.org>
In-reply-to
Content
Could you explain your use-case for this feature in a bit more detail? zipfile is meant to be a relatively high level library to do common tasks such as reading/writing/listing files.

The use case for `data_offset` proposed here seems to be relatively advanced and I don't see how it would be to useful for the vast majority of users.


(Without adding to the public API, I think you can achieve a pretty similar functionality by using the following)

compressed_data = zipfile.open(zipinfo)._read2(compressed_size)

Obviously, this relies on undocumented internals, but for a niche use case that might not be the worst thing: https://github.com/python/cpython/blob/61892c04764e1f3a659bbd09e6373687a27d36e2/Lib/zipfile.py#L1042-L1056
History
Date User Action Args
2021-10-06 15:22:47ammar2setrecipients: + ammar2, zhangxp1998
2021-10-06 15:22:47ammar2setmessageid: <1633533767.42.0.957065093298.issue45006@roundup.psfhosted.org>
2021-10-06 15:22:47ammar2linkissue45006 messages
2021-10-06 15:22:47ammar2create