-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
Closed as not planned
Closed as not planned
Copy link
Labels
stdlibPython modules in the Lib dirPython modules in the Lib dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
Bug description:
While this issue has been fixed for the top-level parser (#72795), it still exists in sub-parsers. This test case (added to test_argparse.py
) fails:
def test_subparser_required_args_zero_or_more(self):
sub_parsers = self.parser.add_subparsers()
sub_parser = sub_parsers.add_parser('sub')
sub_parser.add_argument('bar')
sub_parser.add_argument('baz', nargs='*')
self.assertRaisesRegex(argparse.ArgumentError,
'the following arguments are required: bar$',
self.parser.parse_args, ["sub"])
CPython versions tested on:
CPython main branch
Operating systems tested on:
Linux
Metadata
Metadata
Assignees
Labels
stdlibPython modules in the Lib dirPython modules in the Lib dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Projects
Status
Doc issues