-
-
Notifications
You must be signed in to change notification settings - Fork 34.5k
bpo-44986: Fixed bug with date formats like %Y-%m-%d in help messages of argparse #27923
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
04f909d
36001c7
d77b2b6
255fa92
cbdc58e
f291df2
8ed8045
cd7aebb
1728042
8697b09
a3be094
02e3b73
60c3e50
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -3930,13 +3930,13 @@ class TestHelpWithPercentageSymbols(HelpTestCase): | |||||
| """Test a help message including % symbols""" | ||||||
| parser_signature = Sig(prog='PROG', description='Just a test code.') | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| argument_signatures = [ | ||||||
| Sig('--somearg', metavar='somearg', | ||||||
| Sig('--somearg', metavar='somearg', | ||||||
| help='Now you dont need to escape this: %, and you will not get nonsensical errors!'), | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| Sig('--date', metavar='when', help='A date in format %Y-%m-%d', | ||||||
| Sig('--date', metavar='when', help='A date in format %Y-%m-%d', | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| dest=f'date', type=str, required=True), | ||||||
| Sig('bar', nargs='?', type=int, default=42, | ||||||
| Sig('bar', nargs='?', type=int, default=42, | ||||||
| help='the bar to %(prog)s (default: %(default)s)'), | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| Sig('--weirdarg', metavar='weird', dest=f'weird', type=str, | ||||||
| Sig('--weirdarg', metavar='weird', dest=f'weird', type=str, | ||||||
| required=True, help='A weird arg with 1 %, 2 %%% and 3 %%%%%'), | ||||||
| ] | ||||||
|
|
||||||
|
|
||||||
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.