[New-bugs-announce] [issue29553] Argparser does not display closing parentheses in nested mutex groups

Christoph Stahl report at bugs.python.org
Tue Feb 14 09:59:53 EST 2017


New submission from Christoph Stahl:

When creating nested mutually exclusive groups, all closing brackets except one are omitted.

Example:
parser = ArgumentParser()
group = parser.add_mutually_exclusive_group()
group.add_argument('-a')
group.add_argument('-b')
group2 = group.add_mutually_exclusive_group()
group2.add_argument('-c')
group2.add_argument('-d')
group3 = group2.add_mutually_exclusive_group()
group3.add_argument('-e')
group3.add_argument('-f')

prints a usage line of:
usage: test.py [-h] [-a A | -b B | [-c C | -d D | [-e E | -f F]

it should print something like:
usage: test.py [-h] [-a A | -b B | [-c C | -d D | [-e E | -f F]]]

----------
components: Library (Lib)
messages: 287776
nosy: christofsteel
priority: normal
severity: normal
status: open
title: Argparser does not display closing parentheses in nested mutex groups
versions: Python 2.7, Python 3.6

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


More information about the New-bugs-announce mailing list