You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
argparse: potential bugs on add_subparser due to allow_abbrev cannot deal with short options #88767
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=Nonecreated_at=<Date2021-07-11.23:21:14.214>labels= ['3.8', 'type-bug', 'library', '3.9']
title='argparse: potential bugs on add_subparser due to allow_abbrev cannot deal with short options'updated_at=<Date2021-07-11.23:21:14.214>user='https://github.com/zhongxiang117'
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.
You used confusing terminology. Short options are options consisting of a dash followed by a single non-dash character. Options starting with a single dash and followed by multiple characters are called single-dash long options. Options starting with a double dash are called double-dash long options. Short options cannot be abbreviated, but they can be grouped.
allow_abbre=False is broken for single-dash long options, this is a known bug and it will be fixed by #124340.
Do you have other issues besides allow_abbre=False not working for single-dash long options?
Activity
zhongxiang117 commentedon Jul 11, 2021
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:
contents in link:
https://docs.python.org/3/library/argparse.html#prefix-matching
should be updated to long options (two dashes)
bugs may happen due to
allow_abbrev' cannot handle short options when recycling top-level arguments by usingadd_subparsers'serhiy-storchaka commentedon Sep 26, 2024
You used confusing terminology. Short options are options consisting of a dash followed by a single non-dash character. Options starting with a single dash and followed by multiple characters are called single-dash long options. Options starting with a double dash are called double-dash long options. Short options cannot be abbreviated, but they can be grouped.
allow_abbre=Falseis broken for single-dash long options, this is a known bug and it will be fixed by #124340.Do you have other issues besides
allow_abbre=Falsenot working for single-dash long options?