Message357839
while waiting for a fix, would it be possible to document in the argparse documentation that the 'dest' parameter is required (at least temporarily) for add_subparsers()? (somewhere near file:///usr/share/doc/python/html/library/argparse.html#sub-commands)
gratuitous diff: the pull request from 2017 would probably fix it. my diffs are here (from: Python 3.8.0 (default, Oct 23 2019, 18:51:26). (the pull request changes the utility '_get_action_name'; i wasn't sure of side-effects with other callers, so changed nearer the failure location.)
----
*** new/argparse.py 2019-12-05 11:16:37.618985247 +0530
--- old/argparse.py 2019-10-24 00:21:26.000000000 +0530
***************
*** 2017,2030 ****
for action in self._actions:
if action not in seen_actions:
if action.required:
! ra = _get_action_name(action)
! if ra is None:
! if not action.choices == {}:
! choice_strs = [str(choice) for choice in action.choices]
! ra = '{%s}' % ','.join(choice_strs)
! else:
! ra = '<unknown>'
! required_actions.append(ra)
else:
# Convert action default now instead of doing it before
# parsing arguments to avoid calling convert functions
--- 2017,2023 ----
for action in self._actions:
if action not in seen_actions:
if action.required:
! required_actions.append(_get_action_name(action))
else:
# Convert action default now instead of doing it before
# parsing arguments to avoid calling convert functions |
|
Date |
User |
Action |
Args |
2019-12-05 06:00:18 | Minshall | set | recipients:
+ Minshall, eric.araujo, zachrahan, paul.j3, hroncok, Mathias Ettinger |
2019-12-05 06:00:18 | Minshall | set | messageid: <1575525618.39.0.236559969674.issue29298@roundup.psfhosted.org> |
2019-12-05 06:00:18 | Minshall | link | issue29298 messages |
2019-12-05 06:00:18 | Minshall | create | |
|