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.

classification
Title: missing unittests for overlapping dest when using subparsers
Type: Stage: needs patch
Components: Versions:
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: ALSchwalm, paul.j3, rhettinger
Priority: normal Keywords:

Created on 2021-10-27 16:36 by paul.j3, last changed 2022-04-11 14:59 by admin.

Messages (1)
msg405110 - (view) Author: paul j3 (paul.j3) * (Python triager) Date: 2021-10-27 16:36
https://bugs.python.org/issue45235
argparse does not preserve namespace with subparser defaults

was passed and put into the latest release with rather obvious buggy behavior.  

This means that the unittest file does not adequately test for overlapping 'dest' in the main and subparsers.  It probably also does not test many (any?) cases of user provided namespace.

Issue9351 added a test, but it only tested defaults set with 

parser.set_defaults(foo=1)
xparser.set_defaults(foo=2)

not the more common practice of setting defaults in add_argument.

45235 adds one test, but again only for 

xparser.set_defaults(foo=1)

It doesn't test for user inputs, as with

['X','--foo=3']
History
Date User Action Args
2022-04-11 14:59:51adminsetgithub: 89794
2021-10-27 16:36:51paul.j3create