Skip to content

Preserve stream data after empty iterator chunks - #2253

Open
khushalx wants to merge 1 commit into
apache:trunkfrom
khushalx:codex/stream-empty-chunks
Open

khushalx wants to merge 1 commit into
apache:trunkfrom
khushalx:codex/stream-empty-chunks

Conversation

@khushalx

@khushalx khushalx commented Dec 1, 2026

Copy link
Copy Markdown

Preserve compressed stream data after empty chunks

Description

Fixes #2252.

A streaming compressor can return an empty chunk before producing more bytes. Both stream helpers currently stop there, leaving a truncated archive. Consume iterators until StopIteration so the remaining data reaches the upload.

Three regression tests failed before the fix. The utility and storage suites now pass: 999 tests, 12 skipped. Checks include decompressing a real zlib stream and empty chunks at the start, middle and end of an iterator. Pre-commit checks passed with Python 3.12.

AI disclosure: Codex (GPT-6) reproduced the bug, implemented the fix, wrote the tests and prepared this description.

Status

Ready for review.

Checklist

  • Code linting
  • Changelog
  • Tests

Buffered compressors can yield empty chunks before their final output. Read until StopIteration to avoid truncating uploads.

Assisted-by: Codex:GPT-6
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.

Stream helpers truncate compressed iterators at empty chunks

1 participant