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
Incorrect information in add_subparser() docs. #95377
When setting the flag required=true for the function ArgumentParser.add_subparsers() the setting dest=" some description" also needs to be set or the parser throws an unhelpful error when the user fails to select a subparser.
It’s unclear which Python version this was originally reported against. The underlying problem was fixed in #3680 and backported to Python 3.9 and 3.10. When no subparser is selected, argparse tells the user that one is required: error: the following arguments are required: {foo,bar}
It does not reproduce on any branch in the current support window so I think this can be closed.
Activity
MonadChains commentedon Jul 28, 2022
I agree. The documentation is not fully clear, and adding a line to clarify it could be beneficial, especially given the complexity of the module.
pythongh-95377: Removed unnessecary line in argpase.rst
StanFromIreland commentedon Aug 20, 2026
CC @savannahostrowski
savannahostrowski commentedon Aug 21, 2026
It’s unclear which Python version this was originally reported against. The underlying problem was fixed in #3680 and backported to Python 3.9 and 3.10. When no subparser is selected, argparse tells the user that one is required:
error: the following arguments are required: {foo,bar}It does not reproduce on any branch in the current support window so I think this can be closed.