Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

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

Appearance settings

gh-137571: Fix UnboundLocalError in gzip._GzipReader.read()#137572

Closed
maurycy wants to merge 2 commits into
python:mainpython/cpython:mainfrom
maurycy:fix-issue-137571maurycy/cpython:fix-issue-137571Copy head branch name to clipboard
Closed

gh-137571: Fix UnboundLocalError in gzip._GzipReader.read()#137572
maurycy wants to merge 2 commits into
python:mainpython/cpython:mainfrom
maurycy:fix-issue-137571maurycy/cpython:fix-issue-137571Copy head branch name to clipboard

Conversation

@maurycy

@maurycy maurycy commented Aug 8, 2025

Copy link
Copy Markdown
Contributor

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

@serhiy-storchaka serhiy-storchaka left a comment

Copy link
Copy Markdown
Member

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.

@maurycy

maurycy commented Mar 23, 2026

Copy link
Copy Markdown
Contributor Author

6 months passed; stale.

@maurycy maurycy closed this Mar 23, 2026
@serhiy-storchaka

Copy link
Copy Markdown
Member

@maurycy, it was stale because you have not addressed my comment.

#150222 will fix this issue without changing behavior for other cases.

@maurycy maurycy deleted the fix-issue-137571 branch May 22, 2026 08:26
@maurycy

maurycy commented May 22, 2026

Copy link
Copy Markdown
Contributor Author

@serhiy-storchaka Thank you for picking this up. You're right, and #150222 is a cleaner fix. Apologies for letting this go on my end.

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

Morty Proxy This is a proxified and sanitized view of the page, visit original site.