Repository navigation
Closed
Labels
3.10 (EOL)end of lifeend of life3.11only security fixesonly security fixes3.9 (EOL)end of lifeend of lifestdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
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 = None
closed_at = <Date 2021-10-13.20:37:35.828>
created_at = <Date 2015-06-13.06:47:02.770>
labels = ['type-bug', 'library', '3.9', '3.10', '3.11']
title = 'In argparse empty choices cannot be printed in the help'
updated_at = <Date 2021-10-13.20:37:35.826>
user = 'https://github.com/py-user'bugs.python.org fields:
activity = <Date 2021-10-13.20:37:35.826>
actor = 'lukasz.langa'
assignee = 'none'
closed = True
closed_date = <Date 2021-10-13.20:37:35.828>
closer = 'lukasz.langa'
components = ['Library (Lib)']
creation = <Date 2015-06-13.06:47:02.770>
creator = 'py.user'
dependencies = []
files = []
hgrepos = []
issue_num = 24444
keywords = ['patch']
message_count = 7.0
messages = ['245297', '245448', '273317', '403849', '403858', '403871', '403872']
nosy_count = 5.0
nosy_names = ['py.user', 'lukasz.langa', 'paul.j3', 'miss-islington', 'andrei.avk']
pr_nums = ['28050', '28931', '28932']
priority = 'normal'
resolution = 'fixed'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue24444'
versions = ['Python 3.9', 'Python 3.10', 'Python 3.11']Metadata
Metadata
Assignees
Labels
3.10 (EOL)end of lifeend of life3.11only security fixesonly security fixes3.9 (EOL)end of lifeend of lifestdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Activity
py-user commentedon Jun 13, 2015
It's not very useful to print empty choices, but the choices list could be formed dynamically. So the command-line user can't figure out what's happen.
paulj3 commentedon Jun 18, 2015
Does this work for
Without setting up my own test case, I'm guessing that the problem is with an empty help string.
help=''should be ok, but the test handle that probably occurs earlier.Choices, empty or not, are included earlier in the help line, as well as usage. So there isn't real need to include them in the user defined part of the help line.
Still, there are other bug issues regarding the formatting of choices. That part needs refinement to handle very long lists of choices, as well as ones that don't fit the usual 'list' format.
paulj3 commentedon Aug 21, 2016
This error is also produced by
that is, a help line with all blanks. As long as there is a nonblank character in the help line it format fine.
This issue doesn't need to be resolved by itself, but should be considered if and when the formatting of choices is reworked.
ambv commentedon Oct 13, 2021
New changeset 6fafc25 by andrei kulakov in branch 'main':
bpo-24444: fix an error in argparse help when help for an option is blank (GH-28050)
6fafc25
ambv commentedon Oct 13, 2021
New changeset fd2be6d by Miss Islington (bot) in branch '3.10':
bpo-24444: fix an error in argparse help when help for an option is blank (GH-28050) (GH-28931)
fd2be6d
ambv commentedon Oct 13, 2021
New changeset fb72034 by Miss Islington (bot) in branch '3.9':
[3.9] bpo-24444: fix an error in argparse help when help for an option is blank (GH-28050) (GH-28932)
fb72034
ambv commentedon Oct 13, 2021
Thanks, Andrei! ✨ 🍰 ✨