Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

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

Closed
rhpvorderman wants to merge 2 commits into
python:mainpython/cpython:mainfrom
rhpvorderman:patch-1rhpvorderman/cpython:patch-1Copy head branch name to clipboard
Closed

bpo-45507: Throw EOF error when gzip headers or trailers are truncated#29023
rhpvorderman wants to merge 2 commits into
python:mainpython/cpython:mainfrom
rhpvorderman:patch-1rhpvorderman/cpython:patch-1Copy head branch name to clipboard

Conversation

@rhpvorderman

@rhpvorderman rhpvorderman commented Oct 18, 2021

Copy link
Copy Markdown
Contributor

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

rhpvorderman commented Oct 18, 2021

Copy link
Copy Markdown
Contributor Author

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
Copy Markdown
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

Morty Proxy This is a proxified and sanitized view of the page, visit original site.