GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-137571: Fix `UnboundLocalError` in `gzip._GzipReader.read()` by maurycy · Pull Request #137572 · python/cpython

Conversation

@maurycy

@maurycy maurycy commented Aug 8, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

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).

  • Issue: gzip._GzipReader.read() with sometimes uninitialized variable #137571

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@maurycy
buf exists iff self._decompressor.needs_input
67db028
@bedevere-app bedevere-app Bot added the awaiting review label Aug 8, 2025
@bedevere-app bedevere-app Bot mentioned this pull request Aug 8, 2025
gzip._GzipReader.read() with sometimes uninitialized variable #137571
Closed
@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 reviewed Aug 9, 2025
View reviewed changes

@serhiy-storchaka serhiy-storchaka left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this 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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@maurycy
Merge branch 'main' into fix-issue-137571
572c6d4
@maurycy

maurycy commented Mar 23, 2026

Copy link
Copy Markdown
Contributor Author

6 months passed; stale.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

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

serhiy-storchaka commented May 22, 2026

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 reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

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 left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

awaiting review

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@maurycy @serhiy-storchaka
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.