[issue44601] argparse: potential bugs on add_subparser due to allow_abbrev cannot deal with short options

Xiang Zhong report at bugs.python.org
Sun Jul 11 19:21:14 EDT 2021


New submission from Xiang Zhong <zhongxiang117 at gmail.com>:

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'

----------
components: Library (Lib)
files: myargparse.py
messages: 397268
nosy: zhongxiang117
priority: normal
severity: normal
status: open
title: argparse: potential bugs on add_subparser due to allow_abbrev cannot deal with short options
type: behavior
versions: Python 3.8, Python 3.9
Added file: https://bugs.python.org/file50143/myargparse.py

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44601>
_______________________________________


More information about the Python-bugs-list mailing list