[New-bugs-announce] [issue29777] argparse arguments in main parser hide an argument in subparser

Alan Evangelista report at bugs.python.org
Thu Mar 9 15:35:40 EST 2017


New submission from Alan Evangelista:

If you have a argument named --<prefix> in a subparser and two arguments named --<prefix><any_suffix)> in the main parser and call the Python executable with

python <script.py> --<prefix>

argparse fails with:

error: ambiguous option: --<prefix> could match --<prefix><suffix1>, --<prefix><suffix2>

This probably happens due to how the argument abbreviation parsing is implemented. Is it possible to support disabling argument abbreviation in Python 2.7, as it is done in Python 3?

----------
components: Library (Lib)
messages: 289327
nosy: Alan Evangelista
priority: normal
severity: normal
status: open
title: argparse arguments in main parser hide an argument in subparser
versions: Python 2.7

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


More information about the New-bugs-announce mailing list