Message198507
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. |
|
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 | |
|