[issue11874] argparse assertion failure with brackets in metavars

paul j3 report at bugs.python.org
Sun Jul 14 23:41:41 CEST 2013


paul j3 added the comment:

If the arg_parts are passed through the same cleanup as the 'text' (and empty strings removed), then 

    text = ' '.join(arg_parts)

In that case there would be no need to return both (text, arg_parts).

Parenthesis in the metavar could also create the problem addressed in this thread, except as noted in http://bugs.python.org/issue18349 that 'text' cleanup removes them.

nargs='*' or '+' or integer is another way in which [] could be introduced into the metavar.

----------

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


More information about the Python-bugs-list mailing list