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: EOFErrors should be thrown for truncated gzip members #29029

Merged
merged 1 commit into from
Nov 19, 2021

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

@github-actions
Copy link

This PR is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale Stale PR or inactive for long period of time. label Nov 18, 2021
@rhpvorderman
Copy link
Contributor Author

@ambv I am sorry to bother you. This PR fixes a behavioral change that occurs because of #27941 . Since you reviewed that PR you seem to be the most appropriate person to ping.
It is a very small fix. Again, sorry to bother you!

@ambv
Copy link
Contributor

ambv commented Nov 19, 2021

No bother at all, thanks for pinging me on this!

@ambv ambv merged commit 0ff3d95 into python:main Nov 19, 2021
remykarem pushed a commit to remykarem/cpython that referenced this pull request Dec 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale Stale PR or inactive for long period of time.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants