[issue41047] argparse: misbehavior when combining positionals and choices

2020-06-20 Thread paul j3
Change by paul j3 : -- stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing li

[issue41047] argparse: misbehavior when combining positionals and choices

2020-06-20 Thread paul j3
paul j3 added the comment: It is an old unresolved issue (which resurfaced a few months ago) https://bugs.python.org/issue9625 argparse: Problem with defaults for variable nargs when using choices -- resolution: -> duplicate ___ Python tracker

[issue41047] argparse: misbehavior when combining positionals and choices

2020-06-20 Thread paul j3
paul j3 added the comment: The error is raised in ._get_values with this section: # when nargs='*' on a positional, if there were no command-line # args, use the default if it is anything other than None elif (not arg_strings and action.nargs == ZERO_OR_MORE and

[issue41047] argparse: misbehavior when combining positionals and choices

2020-06-19 Thread James Corbett
Change by James Corbett : -- keywords: +patch pull_requests: +20172 stage: -> patch review pull_request: https://github.com/python/cpython/pull/20997 ___ Python tracker ___ __

[issue41047] argparse: misbehavior when combining positionals and choices

2020-06-19 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +paul.j3, rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscr

[issue41047] argparse: misbehavior when combining positionals and choices

2020-06-19 Thread James Corbett
New submission from James Corbett : The `argparse.ArgumentParser` sometimes rejects positional arguments with no arguments when `choices` is set and `nargs="*"`. When there are no arguments and `nargs` is `"*"`, the default value is chosen, or `[]` if there is no default value. This value is