Message273654
Using argparse does not retain the Namespace variable across sub-parsers.
This prohibits customization of Actions due to "upper" level arguments not being stored in the namespace passed to the sub-parsers.
Hence, one may not create different sub-parsers which depend on an upper level flag.
The reason is the subparser command:
subnamespace, arg_strings = parser.parse_known_args(arg_strings, None)
Which by default passes `None` as the namespace argument.
A simple patch would be to copy the original namespace, which may then be altered. And subsequently restored, based on changes to that namespace. |
|
Date |
User |
Action |
Args |
2016-08-25 15:02:10 | nickpapior | set | recipients:
+ nickpapior |
2016-08-25 15:02:10 | nickpapior | set | messageid: <1472137330.56.0.683571624156.issue27859@psf.upfronthosting.co.za> |
2016-08-25 15:02:10 | nickpapior | link | issue27859 messages |
2016-08-25 15:02:10 | nickpapior | create | |
|