This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Alan Evangelista
Recipients Alan Evangelista
Date 2017-03-09.20:35:40
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1489091740.64.0.424181036659.issue29777@psf.upfronthosting.co.za>
In-reply-to
Content
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?
History
Date User Action Args
2017-03-09 20:35:40Alan Evangelistasetrecipients: + Alan Evangelista
2017-03-09 20:35:40Alan Evangelistasetmessageid: <1489091740.64.0.424181036659.issue29777@psf.upfronthosting.co.za>
2017-03-09 20:35:40Alan Evangelistalinkissue29777 messages
2017-03-09 20:35:40Alan Evangelistacreate