Message198456
Steven's patch (subparse_optionals.diff) run with jakub's test case (argparse_subparses_ambiguous_bug.py) works. But if the input string is
print(parser.parse_args('--foo baz'.split()))
produces
Namespace(cmd=None, foo='baz', foo1=None, foo2=None)
(I added the 'cmd' subparse 'dest').
Two things seem to be going on now:
1) '--foo' is being parsed even though its subparser is not invoked,
2) and the subparser is not required.
The issue of whether subparsers are required or not is another issue. They used to be required, but the testing for 'required' was changed, and subparsers fell through the crack.
I suspect that if the missing subparser error were raised, the first issue wouldn't be apparent. |
|
Date |
User |
Action |
Args |
2013-09-26 23:04:19 | paul.j3 | set | recipients:
+ paul.j3, bethard, eric.araujo, tshepang, jakub |
2013-09-26 23:04:19 | paul.j3 | set | messageid: <1380236659.69.0.466095626084.issue14365@psf.upfronthosting.co.za> |
2013-09-26 23:04:19 | paul.j3 | link | issue14365 messages |
2013-09-26 23:04:19 | paul.j3 | create | |
|