[New-bugs-announce] [issue25058] Right square bracket argparse metavar

Juan Jimenez-Anca report at bugs.python.org
Thu Sep 10 18:30:03 CEST 2015


New submission from Juan Jimenez-Anca:

When trying to assign the metavar in add_argument() method of argparse module I'm unable to include characters after a right square bracket.

Trying to set something like this:

metavar="[host:database:collection:]field"

would raise an AssertionError, which includes:

File "/usr/lib64/python3.4/argparse.py", line 329, in _format_usage
    assert ' '.join(opt_parts) == opt_usage

However, the following is accepted:

metavar="[host:database:collection:]field"

----------
components: Library (Lib)
messages: 250388
nosy: cortopy
priority: normal
severity: normal
status: open
title: Right square bracket argparse metavar
type: behavior
versions: Python 3.4

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


More information about the New-bugs-announce mailing list