[issue22401] argparse: 'resolve' conflict handler damages the actions of the parent parser

2021-01-27 Thread Kuang-che Wu
Change by Kuang-che Wu : -- nosy: +kcwu ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue22401] argparse: 'resolve' conflict handler damages the actions of the parent parser

2016-03-24 Thread paul j3
paul j3 added the comment: Neither 'parents' or 'resolve' are documented in any detail. Most of what I know comes from reading the code. 'parents' are, I think, most useful when importing a parser from some other module. It lets you add arguments to your own parser without digging into the

[issue22401] argparse: 'resolve' conflict handler damages the actions of the parent parser

2016-03-24 Thread Jared Deckard
Jared Deckard added the comment: That is correct. (Thank you for whipping up a repro script from my description). I appreciate the work around, but it is nearly as verbose as manually duplicating the parameters on the child and I would have to type up a large comment block to educate future

[issue22401] argparse: 'resolve' conflict handler damages the actions of the parent parser

2016-03-24 Thread Jared Deckard
Jared Deckard added the comment: Adding back components and version data I unintentionally removed in http://bugs.python.org/msg262314 -- components: +Documentation, Tests versions: +Python 3.5 ___ Python tracker

[issue22401] argparse: 'resolve' conflict handler damages the actions of the parent parser

2016-03-23 Thread paul j3
paul j3 added the comment: Is this the kind of scenario that you have problems with? parser = argparse.ArgumentParser() sp = parser.add_subparsers(dest='cmd') p1 = sp.add_parser('cmd1') p1.add_argument('-f') p2 = sp.add_parser('cmd2') p2.add_argument('-b') p3 =

[issue22401] argparse: 'resolve' conflict handler damages the actions of the parent parser

2016-03-23 Thread Jared Deckard
Jared Deckard added the comment: This behavior is preventing me from using more than one parent parser. My use case is a convenience subcommand that performs two existing subcommands, therefore logically its subparser is required to support the arguments of both subparsers. The only conflict

[issue22401] argparse: 'resolve' conflict handler damages the actions of the parent parser

2014-10-01 Thread paul j3
paul j3 added the comment: A simpler solution is to make a copy of each Action when importing a parent parser. The current practice is to just copy references. With a copy, an Action will belong to only one group and parser, and the 'resolve' handler will operate without problems. In the

[issue22401] argparse: 'resolve' conflict handler damages the actions of the parent parser

2014-09-26 Thread paul j3
Changes by paul j3 ajipa...@gmail.com: Added file: http://bugs.python.org/file36728/sample3.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22401 ___ ___

[issue22401] argparse: 'resolve' conflict handler damages the actions of the parent parser

2014-09-26 Thread paul j3
Changes by paul j3 ajipa...@gmail.com: Removed file: http://bugs.python.org/file36656/sample3.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22401 ___

[issue22401] argparse: 'resolve' conflict handler damages the actions of the parent parser

2014-09-20 Thread paul j3
Changes by paul j3 ajipa...@gmail.com: -- nosy: +bethard ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22401 ___ ___ Python-bugs-list mailing list

[issue22401] argparse: 'resolve' conflict handler damages the actions of the parent parser

2014-09-19 Thread paul j3
Changes by paul j3 ajipa...@gmail.com: Added file: http://bugs.python.org/file36656/sample3.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22401 ___ ___

[issue22401] argparse: 'resolve' conflict handler damages the actions of the parent parser

2014-09-19 Thread paul j3
Changes by paul j3 ajipa...@gmail.com: Removed file: http://bugs.python.org/file36648/sample3.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22401 ___

[issue22401] argparse: 'resolve' conflict handler damages the actions of the parent parser

2014-09-18 Thread paul j3
Changes by paul j3 ajipa...@gmail.com: Added file: http://bugs.python.org/file36648/sample3.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22401 ___ ___

[issue22401] argparse: 'resolve' conflict handler damages the actions of the parent parser

2014-09-18 Thread paul j3
Changes by paul j3 ajipa...@gmail.com: Removed file: http://bugs.python.org/file36635/sample3.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22401 ___

[issue22401] argparse: 'resolve' conflict handler damages the actions of the parent parser

2014-09-17 Thread paul j3
paul j3 added the comment: 'sample3.py' contains a '_handle_conflict_parent' function. With the help of a change in '_add_container_actions' it determines whether a conflicting action occurs in multiple parsers (and argument_groups). If it does, it deletes it from the correct group, without

[issue22401] argparse: 'resolve' conflict handler damages the actions of the parent parser

2014-09-13 Thread paul j3
New submission from paul j3: When there's a conflict involving an argument that was added via 'parents', and the conflict handler is 'resolve', the action in the parent parser may be damaged, rendering that parent unsuitable for further use. In this example, 2 parents have the same '--config'