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 kyleam
Recipients kyleam
Date 2020-02-03.20:11:28
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1580760688.73.0.980793532046.issue39546@roundup.psfhosted.org>
In-reply-to
Content
As of Python v3.8.0 (specifically commit b1e4d1b603), specifying
`allow_abbrev=False` does not disable abbreviation for prefix
characters other than '-'.

--8<---------------cut here---------------start------------->8---
import argparse

parser = argparse.ArgumentParser(prefix_chars='+', allow_abbrev=False)
parser.add_argument('++long')
print(parser.parse_args(['++lo=val']))
--8<---------------cut here---------------end--------------->8---

Observed output (with b1e4d1b603 and current master):

    Namespace(long='val')

Expected (and observed with b1e4d1b603^ and 3.7.3):

    usage: scratch.py [+h] [++long LONG]
    scratch.py: error: unrecognized arguments: ++lo=val


I will follow up with a PR to propose a fix.
History
Date User Action Args
2020-02-03 20:11:28kyleamsetrecipients: + kyleam
2020-02-03 20:11:28kyleamsetmessageid: <1580760688.73.0.980793532046.issue39546@roundup.psfhosted.org>
2020-02-03 20:11:28kyleamlinkissue39546 messages
2020-02-03 20:11:28kyleamcreate