Skip to content

bpo-6584: Add a BadGzipFile exception to the gzip module#13022

Merged
serhiy-storchaka merged 2 commits intopython:masterfrom
ZackerySpytz:bpo-6584-gzip-BadGzipFile
May 13, 2019
Merged

bpo-6584: Add a BadGzipFile exception to the gzip module#13022
serhiy-storchaka merged 2 commits intopython:masterfrom
ZackerySpytz:bpo-6584-gzip-BadGzipFile

Conversation

@ZackerySpytz
Copy link
Copy Markdown
Contributor

@ZackerySpytz ZackerySpytz commented Apr 30, 2019

Co-Authored-By: Filip Gruszczyński [email protected]
Co-Authored-By: Michele Orrù [email protected]

https://bugs.python.org/issue6584

Co-Authored-By: Filip Gruszczyński <[email protected]>
Co-Authored-By: Michele Orrù <[email protected]>
@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.

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.

6 participants