Message371980
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
not action.option_strings):
if action.default is not None:
value = action.default
else:
value = arg_strings
self._check_value(action, value)
An empty 'arg_strings' satisfies the nargs='*', so 'value' is set to that, and passed to _check_value.
We could avoid this by setting the default to one of the valid choices, e.g. 'a'. But then the attribute would be that string, not a list with that string.
I suspect this issue has come up before, since I don't this code has been changed in a long time. |
|
Date |
User |
Action |
Args |
2020-06-21 03:17:54 | paul.j3 | set | recipients:
+ paul.j3, rhettinger, jameshcorbett |
2020-06-21 03:17:54 | paul.j3 | set | messageid: <1592709474.47.0.964910869548.issue41047@roundup.psfhosted.org> |
2020-06-21 03:17:54 | paul.j3 | link | issue41047 messages |
2020-06-21 03:17:53 | paul.j3 | create | |
|