Skip to content

Conversation

@effigies
Copy link
Contributor

@effigies effigies commented Aug 22, 2023

Issue described in detail in #108111.

Short story: write(x); seek(len(x)); write(x) results in b''.join([x, bytes(len(x)), x]) being written. This is due to buffered writes not updating the GzipFile.offset() until flushed. It's possible there could be something more efficient, but this seemed like the simplest solution.

@ghost
Copy link

ghost commented Aug 22, 2023

All commit authors signed the Contributor License Agreement.
CLA signed

@encukou encukou self-requested a review August 23, 2023 14:52
@encukou encukou added the needs backport to 3.12 only security fixes label Aug 23, 2023
@ambv ambv merged commit 2eb60c1 into python:main Aug 24, 2023
@miss-islington
Copy link
Contributor

Thanks @effigies for the PR, and @ambv for merging it 🌮🎉.. I'm working now to backport this PR to: 3.12.
🐍🍒⛏🤖

@bedevere-bot
Copy link

GH-108402 is a backport of this pull request to the 3.12 branch.

@bedevere-bot bedevere-bot removed the needs backport to 3.12 only security fixes label Aug 24, 2023
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Aug 24, 2023
…rites (pythonGH-108341)

(cherry picked from commit 2eb60c1)

Co-authored-by: Chris Markiewicz <[email protected]>
Co-authored-by: Łukasz Langa <[email protected]>
Yhg1s pushed a commit that referenced this pull request Aug 24, 2023
…writes (GH-108341) (#108402)

gh-108111: Flush gzip write buffer before seeking, fixing bad writes (GH-108341)
(cherry picked from commit 2eb60c1)

Co-authored-by: Chris Markiewicz <[email protected]>
Co-authored-by: Łukasz Langa <[email protected]>
@effigies effigies deleted the fix/gzip-writeseekwrite branch August 24, 2023 16:05
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.

5 participants