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.

classification
Title: allow_abbrev not working as intended in "argparse.ArgumentParser" in Python 3.9.0
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.9
process
Status: closed Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: Rin, paul.j3, rhettinger
Priority: normal Keywords:

Created on 2020-10-21 09:44 by Rin, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
mcve.py Rin, 2020-10-21 09:44
Messages (2)
msg379202 - (view) Author: Rin RIn (Rin) Date: 2020-10-21 09:44
the "allow_abbrev" in "argparse.ArgumentParser" behavior does not work as intended in python 3.9.0

$ python3 --version
Python 3.5.3
$ python3 mcve.py -S
$ python3 mcve.py -SS
usage: mcve.py [-h] [-S]
mcve.py: error: unrecognized arguments: -SS

$ python3.9 --version
Python 3.9.0
$ python3.9 mcve.py -S
$ python3.9 mcve.py -SS # no erros raised here
$

Have attached a sample file to check this
msg379213 - (view) Author: paul j3 (paul.j3) * (Python triager) Date: 2020-10-21 15:31
argparse : allow_abbrev behavior between 3.7 and 3.8
https://bugs.python.org/issue41534

covers this issue well enough.  That latest change to `allow_abbrev` was prompted by:

argparse: allow_abbrev=False stops -vv from working
https://bugs.python.org/issue26967

You also raised this issue on StackOverFlow.  That may be a better place to discuss this.
History
Date User Action Args
2022-04-11 14:59:37adminsetgithub: 86271
2020-10-21 15:31:15paul.j3setstatus: open -> closed

messages: + msg379213
stage: resolved
2020-10-21 12:10:36xtreaksetnosy: + rhettinger, paul.j3
2020-10-21 09:44:15Rincreate