Skip to content

Conversation

maurycy
Copy link
Contributor

@maurycy maurycy commented Aug 8, 2025

Much more detailed description, including the reproduction steps, in the issue.

I'm not 100% sure about the fix. The easiest is just a sentinel (buf = None).

@maurycy maurycy changed the title gh-137571: gzip: Fix UnboundLocalError in gzip._GzipReader.read() gh-137571: Fix UnboundLocalError in gzip._GzipReader.read() Aug 8, 2025
Copy link
Member

@serhiy-storchaka serhiy-storchaka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This may change the behavior. Before, the error was raised only if both uncompress and buf are empty. Now it is raised without an attempt to decompress.

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.

2 participants