Repository navigation
Respect file cursor positions when calculating raw content length - #1214
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Merging this PR will not alter performance
Comparing Footnotes
|
There was a problem hiding this comment.
All reported issues were addressed across 4 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
Calculate
Content-Lengthforcontent=fileobjfrom the current cursor, using zero at or past EOF and chunked transfer when the length cannot be determined. Use logical seek/tell measurements so transformed streams do not mix compressed file sizes with decompressed offsets; this can scan compressed streams during length detection. Leave multipart rewind behavior unchanged.Add five focused public-API regression cases: a partial file, EOF, past EOF, a gzip stream, and a non-seekable pipe. Keep the existing
BytesIOtest and the multipart length assertion.Validation on Python 3.15: 1,740 tests passed, 1 skipped, and 5 network tests excluded. Ruff and mypy pass; all changed files have 100% coverage.
AI Disclaimer
This PR was developed with the assistance of either Claude or Codex. I've reviewed and verified the changes.