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 paul.j3
Recipients jzwinck, paul.j3
Date 2016-04-25.05:24:44
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1461561884.71.0.635491907194.issue20430@psf.upfronthosting.co.za>
In-reply-to
Content
I just found a case where `dest` is `SUPPRESS` - the default subparsers setup.

      _SubParsersAction(option_strings=[], dest='==SUPPRESS==', nargs='A...', ...

If I make this Action 'required' (in the current distribution 'subparsers' are not required - there's a bug/issue for that)

     parser._actions[1].required=True

and call the parser without the required subparser argument I should get an error message.  In earlier versions this would have been a non specific,  `error: too few arguments', but the new one tries to name the missing argument, e.g.

    program: error: the following arguments are required: choice

But with SUPPRESS I get a further error as _parse_known_args tries to format this error message:

C:\Users\paul\Miniconda3\lib\argparse.py in _parse_known_args(self, arg_strings, namespace)
   1991         if required_actions:
   1992             self.error(_('the following arguments are required: %s') %
-> 1993                        ', '.join(required_actions))

TypeError: sequence item 0: expected str instance, NoneType found

(This error may have been reported elsewhere.  This issue is the first one I found that deals with `dest=argparse.SUPPRESS`.)
History
Date User Action Args
2016-04-25 05:24:44paul.j3setrecipients: + paul.j3, jzwinck
2016-04-25 05:24:44paul.j3setmessageid: <1461561884.71.0.635491907194.issue20430@psf.upfronthosting.co.za>
2016-04-25 05:24:44paul.j3linkissue20430 messages
2016-04-25 05:24:44paul.j3create