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

Jakub Warmuz report at bugs.python.org
Sun Mar 18 21:28:00 CET 2012


New submission from Jakub Warmuz <jakub.warmuz+bugs.python.org at gmail.com>:

Assuming following:
1. optional argument, say "--foo", in a subparser;
2. at least two different optional arguments in the main parser prefixed with "--foo", say "--foo1" and "--foo2";

parsing fails with "error: ambiguous option: --foo could match --foo1, --foo2".

It seems like argument abbreviation mechanism described at http://docs.python.org/library/argparse.html#argument-abbreviations is not working properly when in use with subparsers...

----------
components: Library (Lib)
files: argparse_subparsers_ambiguous_bug.py
messages: 156272
nosy: bethard, jakub
priority: normal
severity: normal
status: open
title: argparse: subparsers, argument abbreviations and ambiguous option
type: behavior
versions: Python 2.7, Python 3.2
Added file: http://bugs.python.org/file24928/argparse_subparsers_ambiguous_bug.py

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


More information about the Python-bugs-list mailing list