Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpo-45507: Throw EOF error when gzip headers or trailers are truncated #29023

Closed
wants to merge 2 commits into from

Conversation

rhpvorderman
Copy link
Contributor

@rhpvorderman rhpvorderman commented Oct 18, 2021

This is to keep error compatibility with 3.10 and lower.

It was missed in my last PR #27941. When the gzip member contains an incomplete trailer (less than 8 bytes) the GzipFile-based implementation of 3.10 and below would throuw an EOF error, so the newer in-memory implementation should do the same.
Currently it throws 'struct.error: unpack requires a buffer of 8 bytes' when the trailer is truncated.

https://bugs.python.org/issue45507

@rhpvorderman
Copy link
Contributor Author

rhpvorderman commented Oct 18, 2021

This can have a 'skip news' label, but I can't add it myself. Added regression tests now and added a news item accordingly.

This is to keep error compatibility with 3.10 and lower.
@rhpvorderman rhpvorderman changed the title bpo-45507: Throw EOF error when trailer is not present in gzip member bpo-45507: Throw EOF error when gzip headers or trailers are truncated Oct 18, 2021
@rhpvorderman
Copy link
Contributor Author

Closing this PR as it confounds two issues: Header and trailer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants