[issue26952] argparse help formatter crashes

2019-07-07 Thread paul j3
paul j3 added the comment: Xiang Zhang pointed out that the immediate error in this case was caused by the empty mutually exclusive group: https://bugs.python.org/issue26952#msg264835 The nesting fails because adding actions to the argument_group does not enroll them in the mutually

[issue26952] argparse help formatter crashes

2019-07-07 Thread Alexander Kapshuna
Alexander Kapshuna added the comment: I have a feeling that nesting groups has nothing to do with it. Got same traceback when I forgot to fill my mutually exclusive groups with arguments. import argparse parser = argparse.ArgumentParser() group = parser.add_mutually_exclusive_group()

[issue26952] argparse help formatter crashes

2018-09-22 Thread paul j3
paul j3 added the comment: https://bugs.python.org/issue29553 deals with a similar problem, the usage display when one mutually exclusive group is embedded in another mutually exclusive group. In that case, usage is displayed, but with some missing brackets. As here there are two issues

[issue26952] argparse help formatter crashes

2018-09-22 Thread paul j3
paul j3 added the comment: If I add an argument to the mutexGroup as suggested by xiang In [7]: mutexGroup.add_argument('--foo', action='store_true') Out[7]: _StoreTrueAction(option_strings=['--foo'], dest='foo', nargs=0, const=True, default=False, type=None, choices=None, help=None,

[issue26952] argparse help formatter crashes

2018-07-11 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- type: crash -> behavior ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue26952] argparse help formatter crashes

2016-05-08 Thread paul j3
paul j3 added the comment: Argument Groups are not designed for nesting, and despite their names and subclassing, Mutually exclusive groups and Argument Groups are not meant to be used together (with one exception). I agree that the error is obscure, but it occurs in a particularly fragile

[issue26952] argparse help formatter crashes

2016-05-04 Thread Xiang Zhang
Xiang Zhang added the comment: I agree with Berker. Even without any exceptions, the help message given is not what add_argument_group and add_mutually_exclusive_group intend. You can see usage: argparse_test.py [-h] [--foo] -u URL -p PROJECT [--dump] --mergeInput

[issue26952] argparse help formatter crashes

2016-05-04 Thread Xiang Zhang
Changes by Xiang Zhang : -- nosy: +bethard ___ Python tracker ___ ___ Python-bugs-list

[issue26952] argparse help formatter crashes

2016-05-04 Thread Endre
Endre added the comment: Hi, Thanks for taking a look at it. I have only tried it with argparse-1.4.0. "I don't think add_mutually_exclusive_group and add_argument_group are designed to work together." Yes, it really works strange in this case. I guess the framework should raise an

[issue26952] argparse help formatter crashes

2016-05-04 Thread Xiang Zhang
Xiang Zhang added the comment: This error occurs due to there is no action belong to the mutexGroup, the code requires at least one. You can simply add mutexGroup.add_argument('--foo', action='store_true') and you'll see the error disappears. I have no idea that this behaviour is

[issue26952] argparse help formatter crashes

2016-05-04 Thread Berker Peksag
Berker Peksag added the comment: I don't think add_mutually_exclusive_group and add_argument_group are designed to work together. Did this worked with argparse 1.3.0 or stdlib version of argparse before? I'm getting the same traceback in 2.7 and 3.4+. -- nosy: +berker.peksag

[issue26952] argparse help formatter crashes

2016-05-04 Thread Xiang Zhang
Changes by Xiang Zhang : -- nosy: +xiang.zhang ___ Python tracker ___ ___ Python-bugs-list

[issue26952] argparse help formatter crashes

2016-05-04 Thread Endre
New submission from Endre: I am using argparse-1.4.0. For this code exception is thrown when the script is started with the -h option: http://pastebin.com/dFF1paFA This exception is thrown: Traceback (most recent call last): File