[issue14365] argparse: subparsers, argument abbreviations and ambiguous option

Steven Bethard report at bugs.python.org
Mon Mar 19 02:51:55 CET 2012


Steven Bethard <steven.bethard at gmail.com> added the comment:

The problem is basically that _parse_known_args calls _parse_optional to determine whether something is an optional or a positional. But _parse_optional only checks "if arg_string in self._option_string_actions", that is, if the string can be found in the main parser actions.

So either this method needs to check the subparser actions, or the "if arg_string in self._option_string_actions" stuff needs to be delayed until the subparser. Neither of these seems like a simple change, but I agree it's a bug.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue14365>
_______________________________________


More information about the Python-bugs-list mailing list