bpo-6584: Add a BadGzipFile exception to the gzip module by ZackerySpytz · Pull Request #13022 · python/cpython

Skip to content

Navigation Menu

Sign in

Appearance settings

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

Sign up

Appearance settings

Conversation

@ZackerySpytz

Copy link Copy Markdown

Contributor

@ZackerySpytz ZackerySpytz commented

Apr 30, 2019

edited by bedevere-bot

Loading

Co-Authored-By: Filip Gruszczyński gruszczy@gmail.com
Co-Authored-By: Michele Orrù maker@tumbolandia.net

https://bugs.python.org/issue6584

Co-Authored-By: Filip Gruszczyński <gruszczy@gmail.com>
Co-Authored-By: Michele Orrù <maker@tumbolandia.net>

@ZackerySpytz

Copy link Copy Markdown

Contributor Author

EOFError can be raised in some cases in the gzip module, and this was added to match with
bz2 and lzma (https://bugs.python.org/issue1159051 / cc0172c). I don't think these cases should be replaced with BadGzipFile.

@serhiy-storchaka

Copy link Copy Markdown

Member

It should be documented clearly that BadGzipFile is not the only exception raised by corrupted gzip files. EOFError and zlib.error also can be raised.

@ZackerySpytz

Copy link Copy Markdown

Contributor Author

@serhiy-storchaka Thank you for your comment, Serhiy! EOFError and zlib.error are now mentioned in the gzip documentation. Please take a look.

@csabella

Copy link Copy Markdown

Contributor

@serhiy-storchaka, is this ready to be merged? Thanks!

@serhiy-storchaka serhiy-storchaka merged commit cf599f6 into python:master

May 13, 2019

@serhiy-storchaka

Copy link Copy Markdown

Member

It was ready to merged. I just gave a chance to other core devs to make a review.

csabella reacted with thumbs up emoji

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

Reviewers

@serhiy-storchaka serhiy-storchaka serhiy-storchaka approved these changes

+1 more reviewer

@auvipy auvipy auvipy approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

6 participants

@ZackerySpytz @serhiy-storchaka @csabella @auvipy @the-knights-who-say-ni @bedevere-bot