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 ericvw, nickpapior, paul.j3
Date 2016-09-04.16:36:55
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1473007015.86.0.502630230116.issue27859@psf.upfronthosting.co.za>
In-reply-to
Content
I've posted a file that runs your code as you expect.

It uses a custom Action class (like your test case).  It subclasses ._SubParsersAction, and replaces the 9351 namespace use with the original one.  I use the registry to change the class that parser.add_subparsers() uses.

The stock argparse.py file does not need to be changed.

ps

In your custom Action I access `namespace.foo` with `getattr(namespace, 'foo', None)` which is how argparse accesses the namespace, and does not throw attribute errors.
History
Date User Action Args
2016-09-04 16:36:55paul.j3setrecipients: + paul.j3, ericvw, nickpapior
2016-09-04 16:36:55paul.j3setmessageid: <1473007015.86.0.502630230116.issue27859@psf.upfronthosting.co.za>
2016-09-04 16:36:55paul.j3linkissue27859 messages
2016-09-04 16:36:55paul.j3create