Skip to content

Fix race condition bug, update supported Python versions#42

Merged
bguise987 merged 3 commits intomasterfrom
develop
Mar 11, 2026
Merged

Fix race condition bug, update supported Python versions#42
bguise987 merged 3 commits intomasterfrom
develop

Conversation

@bguise987
Copy link
Copy Markdown
Owner

No description provided.

bguise987 and others added 3 commits January 22, 2026 16:54
* Update tox.ini for newer file format and new Python versions

* Update GitHub Actions workflow to use newer Python versions

* Update GitHub Actions versions

* Specify GitHub actions Python versions as strings
* Fix race condition causing intermittent gzip corruption

The _process_chunk method checked _last_chunk to determine whether to
use Z_FINISH, but _last_chunk wasn't set until after the read thread
submitted the final chunk. This caused the last chunk to sometimes be
compressed with Z_SYNC_FLUSH instead of Z_FINISH, producing invalid
gzip files with unterminated deflate streams (00 00 FF FF marker).

Fix by peeking ahead in _read_file to determine is_last before
submitting to the pool, and passing the flag directly to _process_chunk.

* Update tests to reflect passing in is_last to _process_chunk

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
@bguise987 bguise987 merged commit e83bafc into master Mar 11, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant