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: argparse: potential bugs on add_subparser due to allow_abbrev cannot deal with short options
Type: behavior Stage:
Components: Library (Lib) Versions: Python 3.9, Python 3.8
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: zhongxiang117
Priority: normal Keywords:

Created on 2021-07-11 23:21 by zhongxiang117, last changed 2022-04-11 14:59 by admin.

Files
File name Uploaded Description Edit
myargparse.py zhongxiang117, 2021-07-11 23:21 reproduce and explanations
Messages (1)
msg397268 - (view) Author: Xiang Zhong (zhongxiang117) * Date: 2021-07-11 23:21
Additional argument like "allow_abbrev_short" should be added to avoid those potential bugs due to abbreviations on short options cannot be handled by "allow_abbrev".

To reproduce and be well explanation, please check on my attached testing file.

The following is the excerpt:

1) contents in link:
   https://docs.python.org/3/library/argparse.html#prefix-matching
   should be updated to long options (two dashes)

2) bugs may happen due to `allow_abbrev' cannot handle short options
   when recycling top-level arguments by using `add_subparsers'
History
Date User Action Args
2022-04-11 14:59:47adminsetgithub: 88767
2021-07-11 23:21:14zhongxiang117create