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

Preserve exceptions raised by a wrapped python fileobj #152

Merged
merged 1 commit into from
Nov 14, 2024

Conversation

camillol
Copy link
Contributor

@camillol camillol commented Nov 9, 2024

When wrapping a file object, if it raises an exception upon read, it currently gets entirely overwritten by the ZranError raised by IndexedGzipFile. With this change, the original exception will be preserved as the cause of the ZranError.

The original exception can contain important information, and with this it will be included in the traceback.

… the cause of

the ZranError raised by IndexedGzipFile, instead of discarding it.

The original exception can contain important information, and with this it will be
included in the traceback.
@pauldmccarthy
Copy link
Owner

Hi @camillol, thanks - this sounds like a good idea. I'll have a closer look tomorrow, and should be able to get a new release out by the end of the week.

@camillol
Copy link
Contributor Author

camillol commented Nov 13, 2024 via email

@pauldmccarthy pauldmccarthy merged commit 27af825 into pauldmccarthy:main Nov 14, 2024
@pauldmccarthy
Copy link
Owner

@camillol I've just released 1.9.1 with this change - thanks!

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.

2 participants