Skip to content

Conversation

@savannahostrowski
Copy link
Member

@savannahostrowskisavannahostrowski commented Dec 18, 2025

@alexprengere
Copy link
Contributor

alexprengere commented Dec 19, 2025

Thanks for working on this and fixing the bug I introduced 😭 (I was planning to fix it today but saw your PR).
One minor nit: I tested it locally and this will raise when %% is encountered in the help text:

# parser.add_argument("--str", default="test", help="100%%")#Traceback (mostrecentcalllast): File"/Users/aprengere/Dev/cpython/Lib/argparse.py", line1810, in_check_helpformatter._expand_help(action) ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^File"/Users/aprengere/Dev/cpython/Lib/argparse.py", line712, in_expand_helpraiseValueError(f"invalid format specifier in: {help_string!r}") ValueError: invalidformatspecifierin: '100%%'

This is due to the final check:

if'%'inresult: raiseValueError(f"invalid format specifier in: {help_string!r}")

Removing this check it makes test_invalid_help fail though.

@savannahostrowski
Copy link
MemberAuthor

Hey folks - thanks for the thoughtful and thorough feedback on this PR! Apologies for the delay in addressing it - I was out on vacation over the holidays!

@savannahostrowskisavannahostrowski enabled auto-merge (squash) January 7, 2026 17:13
@savannahostrowskisavannahostrowski merged commit 9a3263f into python:mainJan 7, 2026
46 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@savannahostrowski@alexprengere@hugovk@serhiy-storchaka@hamdanal