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.

Author carsonwilber
Recipients carsonwilber
Date 2020-11-25.04:36:54
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1606279014.6.0.265447168891.issue42457@roundup.psfhosted.org>
In-reply-to
Content
ArgumentParser improperly resolves arguments in an improper order when using nested subparsers if there are required arguments at more than one layer.

A minimum viable reproduction is to create a set of subparsers on a primary parser, and a set of subparsers on at least one of those parsers. On the main parser and the first-level subparser, add a required argument (in any position as they are appended to the end.)

If you attempt to, for example, print the help for a second-level subparser, an error will be thrown and the parser will exit due to the required argument(s) not being provided, despite the expected behavior and the nature of the -h flag not requiring those arguments to be provided.

For lack of an appropriate means to show a complete minimum viable reproduction here, please see this StackOverflow thread I initially created believing this to be user error (having now determined this is a bug in behavior):

https://stackoverflow.com/questions/64908447/printing-help-for-nested-subparsers-with-required-positional-arguments
History
Date User Action Args
2020-11-25 04:36:54carsonwilbersetrecipients: + carsonwilber
2020-11-25 04:36:54carsonwilbersetmessageid: <1606279014.6.0.265447168891.issue42457@roundup.psfhosted.org>
2020-11-25 04:36:54carsonwilberlinkissue42457 messages
2020-11-25 04:36:54carsonwilbercreate