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.
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
bpo-29298: Fix crash with required subparsers without dest #3680
bpo-29298: Fix crash with required subparsers without dest #3680
Changes from all commits
d8bb0bd
fd1a8c0
6a09976
36e8f80
File filter
Conversations
Jump to
There are no files selected for viewing
merwokSep 20, 2017
Member
The test doesn’t really help me understand what this change does (i.e. what a human would see in an error case).
I’m also not sure if some of the changes in the various patches for bpo-9253 (especially in tests) could be useful here.
asottileSep 20, 2017
Author
Contributor
I'll check those out. I had a difficult time demonstrating (by assertion) the actual output (didn't find any examples) -- I'll bang against that and hopefully I'll make something more expressive :)
asottileSep 22, 2017
•
edited
Author
Contributor
@merwok looks like they had the same idea I had (but a different implementation) -- I took inspiration from one of their tests for additional coverage and updated the tests to hopefully be more expressive (and have a better failure mode)
encukouMay 25, 2018
Member
Code for this is already in
_metavar_formatter
:The metavar formatter can be called, if the parser is known (as
self
), using:Perhaps
_get_action_name
should be made into a method, or take the parser as an optional argument?serhiy-storchakaMay 11, 2018
Member
Add a space after comma. Why braces are used?
merwokMay 11, 2018
Member
I think this is a notation for alternatives: it means one of foo or bar is required.
asottileMay 11, 2018
Author
Contributor
This is consistent with the rendering of
choices
:serhiy-storchakaMay 11, 2018
Member
"foo, bar" is duplicated. And this error message looks confusing to me. What it means?
asottileMay 11, 2018
Author
Contributor
yeah I didn't really know what to do for this, it's essentially an anonymous positional choices argument. Personally I'd love a default
dest='command'
but I imagine that could cause some incompatibility?Then this would read something like
error: argument command: invalid choice ...