FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

GH-139862: Fix direct instantiation of `HelpFormatter` by savannahostrowski · Pull Request #142384 · python/cpython · GitHub

/ cpython Public

GH-139862: Fix direct instantiation of HelpFormatter - #142384

Merged
savannahostrowski merged 3 commits into
python:mainfrom
savannahostrowski:fix-help-format-color
Dec 7, 2025
Merged

GH-139862: Fix direct instantiation of HelpFormatter#142384
savannahostrowski merged 3 commits into
python:mainfrom
savannahostrowski:fix-help-format-color

Conversation

savannahostrowski commented Dec 7, 2025
edited by bedevere-app Bot
Loading

Copy link
Copy Markdown
Member

Based on #142274 (comment), the issue here is that format_help() eventually accesses self._theme but _theme was never set since _set_color() is no longer called in __init__. I think we can initialize _theme to a safe default (no color) so that direct instantiation works but the parser can still override it afterward.

Copy link
Copy Markdown
Member Author

@hamdanal Mind also taking a look at this and making sure everything is fixed on your end?

hamdanal left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

This fixes the problem. Thank you.

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Worth adding a regression test?

savannahostrowski enabled auto-merge (squash) December 7, 2025 20:36
savannahostrowski merged commit dc9f238 into python:main Dec 7, 2025
44 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

3 participants


Back | FazBrowse Home | New Git URL