Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reading an
igzip.openstream after a backward seek can raiseBadGzipFile, even when the archive was written by standard gzip.GzipReader_seekrewinds the underlying file and resets the inflater, but retains pointers to compressed data buffered before the seek. That stale data can be interpreted as a new gzip header.Reset both compressed-input pointers after successfully rewinding the file, and release the Python return value from the underlying seek call. Add seven regression checks using standard gzip and igzip writers, repeated and random data, multiple forward/backward positions, and the raw reader.
A public-API reproducer uses
data = b'hello world' * 24000, reads 400 bytes afterseek(12345), then callsseek(0)andread().Validation on Linux x86_64 / CPython 3.14.7:
The sanitizer run used CPython 3.14 with
PYTHONMALLOC=malloc,detect_leaks=1, and pytest plugin autoload disabled; pytest-timeout was explicitly enabled. It was not the debug-interpreter tox environment. Skips are the existing big-memory and unsupported copy scenarios.Checklist