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 subparser help text is not escaped before string formatting
Type: crash Stage: resolved
Components: Library (Lib) Versions: Python 3.10, Python 3.9, Python 3.8, Python 3.7
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: iritkatriel, pbsds
Priority: normal Keywords:

Created on 2022-01-21 11:37 by pbsds, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
repro.py pbsds, 2022-01-21 11:37 Reproduction
Messages (2)
msg411110 - (view) Author: Peder Bergebakken Sundt (pbsds) * Date: 2022-01-21 11:37
The `help` text in add_argument of a subparser in argparse can not contain a `%`, as it will affect string formatting. This often results in an exception.

See repro.py for a reproduction, tested in Python 3.7 - 3.10.
msg411237 - (view) Author: Irit Katriel (iritkatriel) * (Python committer) Date: 2022-01-22 09:03
This is a feature. See https://docs.python.org/3/library/argparse.html#help
History
Date User Action Args
2022-04-11 14:59:55adminsetgithub: 90611
2022-01-22 09:03:07iritkatrielsetstatus: open -> closed

nosy: + iritkatriel
messages: + msg411237

resolution: not a bug
stage: resolved
2022-01-21 11:38:04pbsdssettype: crash
2022-01-21 11:37:00pbsdscreate