This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author jotomicron
Recipients jotomicron
Date 2015-03-27.18:02:33
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1427479353.63.0.760069319945.issue23795@psf.upfronthosting.co.za>
In-reply-to
Content
The usage that is printed by argparse with the "--help" argument is slightly incorrect when using mutually exclusive groups. This happens in version 3.4.3 but did not happen in version 3.4.0.

I have this minimal example:

import argparse

p = argparse.ArgumentParser()

g1 = p.add_mutually_exclusive_group(required=False)
g1.add_argument("-a")
g1.add_argument("-b")

g2 = p.add_mutually_exclusive_group(required=False)
g2.add_argument("-c")
g2.add_argument("-d")

p.parse_args()

In python 3.4.0, "python test.py --help" produces the usage:

usage: test.py [-h] [-a A | -b B] [-c C | -d D]

In python 3.4.3, the usage is:

usage: test.py [-h] [-a A | -b B [-c C | -d D]

Note the absence of the closing square bracket after B.
History
Date User Action Args
2015-03-27 18:02:33jotomicronsetrecipients: + jotomicron
2015-03-27 18:02:33jotomicronsetmessageid: <1427479353.63.0.760069319945.issue23795@psf.upfronthosting.co.za>
2015-03-27 18:02:33jotomicronlinkissue23795 messages
2015-03-27 18:02:33jotomicroncreate