[issue22363] argparse AssertionError with add_mutually_exclusive_group and help=SUPPRESS

paul j3 report at bugs.python.org
Tue Sep 9 08:10:56 CEST 2014


paul j3 added the comment:

This assertion has triggered several bug issues, either due to an empty group like this, or certain characters in the metavars.

http://bugs.python.org/issue17890
'argparse: mutually exclusive groups full of suppressed args can cause AssertionErrors'

http://bugs.python.org/issue11874 
'argparse assertion failure with brackets in metavars'

http://bugs.python.org/issue16360 
'argparse: comma in metavar causes assertion failure when formatting long usage message'

I think this is a duplicate of 17890, though I'll have to look more closely at your patch to see what it adds.

For 11874 I proposed a major rewrite of the usage formatting.  There I format each group and/or action separately, and keep the pieces in a list.  That way it's easier to filter out empty pieces, and avoids the complex split that gives headaches when the usage is long enough to wrap.

----------
nosy: +paul.j3

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue22363>
_______________________________________


More information about the Python-bugs-list mailing list