Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork34k
GH-139862: Fix direct instantiation ofHelpFormatter#142384
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
GH-139862: Fix direct instantiation ofHelpFormatter#142384
Uh oh!
There was an error while loading.Please reload this page.
Conversation
savannahostrowski commentedDec 7, 2025
@hamdanal Mind also taking a look at this and making sure everything is fixed on your end? |
hamdanal left a comment
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 fixes the problem. Thank you.
hugovk left a comment
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.
Worth adding a regression test?
dc9f238 intopython:mainUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Based on#142274 (comment), the issue here is that
format_help()eventually accessesself._themebut_themewas never set since_set_color()is no longer called in__init__. I think we can initialize_themeto a safe default (no color) so that direct instantiation works but the parser can still override it afterward.argparseformatter handling ofcolor#139862