You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
random access uncompressed unencrypted ZipExtFile #128131
There is a bug in zipfile._SharedFile.seek() that affects concurrent reads of uncompressed, unencrypted files which should be merged along with this PR: #127856
Can you revise the original post to clarify what’s going on here? I read it, but I don’t understand: what is wrong with the current behavior? Under what conditions do the problems occur and thus who is affected? What do you expect instead? Just articulate as much as you can so it’s clear from the problem description what the proposed improvement is.
Thanks vvb2060. Let me re-articulate what I think you're saying.
In #27737, the zipfile module introduced the possibility of seeking within a zip file, but only for compressed or encrypted payloads. Today, if someone attempts to seek with an offset that's 0 or negative, the wrong logic is reached, and an error occurs. Instead, it should be straightforward to enable seeking in any direction (any value of read_offset) consistently (for unencrypted, uncompressed files).
Activity
danifus commentedon Dec 22, 2024
There is a bug in
zipfile._SharedFile.seek()that affects concurrent reads of uncompressed, unencrypted files which should be merged along with this PR: #127856jaraco commentedon Dec 26, 2024
Can you revise the original post to clarify what’s going on here? I read it, but I don’t understand: what is wrong with the current behavior? Under what conditions do the problems occur and thus who is affected? What do you expect instead? Just articulate as much as you can so it’s clear from the problem description what the proposed improvement is.
vvb2060 commentedon Dec 31, 2024
#27737 does not really support random access, currently zipfile can only read uncompressed unencrypted ZipExtFile sequentially (only forward seek).
jaraco commentedon Jan 20, 2025
Thanks vvb2060. Let me re-articulate what I think you're saying.
In #27737, the zipfile module introduced the possibility of seeking within a zip file, but only for compressed or encrypted payloads. Today, if someone attempts to seek with an offset that's 0 or negative, the wrong logic is reached, and an error occurs. Instead, it should be straightforward to enable seeking in any direction (any value of read_offset) consistently (for unencrypted, uncompressed files).
GH-128131: Completely support random read access of uncompressed unen…
pythonGH-128131: Completely support random read access of uncompresse…
pythonGH-128131: Completely support random read access of uncompresse…
[3.13] GH-128131: Completely support random read access of uncompress…
picnixz commentedon Jan 20, 2025
See #128143 (comment) for the rationale of backports and the
type-buglabel.[3.12] GH-128131: Completely support random read access of uncompress…
picnixz commentedon Jan 20, 2025
Closing since completed and backported. Thank you everyone.
pythonGH-128131: Completely support random read access of uncompresse…