Message198507
| Author |
paul.j3 |
| Recipients |
bethard, eric.araujo, jakub, paul.j3, tshepang |
| Date |
2013年09月28日.06:32:35 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1380349955.82.0.292203483103.issue14365@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
I think the correction to the problem that I noted in the previous post is to return 'None, arg_string, None', rather than 'action, arg_string, None' in the case where the action is found in a subparser.
This is what '_parse_optional' does at the end:
# it was meant to be an optional but there is no such option
# in this parser (though it might be a valid option in a subparser)
return None, arg_string, None
An input like '--foo baz' would then produce an 'invalid choice' error. Since '--foo' is an optional that the primary parser does not recognize, 'baz' in interpreted as a positional, in this case an invalid subparser choice.
I'm working on cleaning up a test script. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2013年09月28日 06:32:35 | paul.j3 | set | recipients:
+ paul.j3, bethard, eric.araujo, tshepang, jakub |
| 2013年09月28日 06:32:35 | paul.j3 | set | messageid: <1380349955.82.0.292203483103.issue14365@psf.upfronthosting.co.za> |
| 2013年09月28日 06:32:35 | paul.j3 | link | issue14365 messages |
| 2013年09月28日 06:32:35 | paul.j3 | create |
|