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 samwyse
Recipients samwyse
Date 2021-10-28.18:27:12
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1635445632.13.0.297943907791.issue45656@roundup.psfhosted.org>
In-reply-to
Content
Using the prefix_chars argument to parser.add_argument_group causes usage information to print correctly, but the resulting parser doesn't recognize the options.  The included program reproduces the issue; it produces the following output on my system.

--- python version
3.6.8 (default, Sep 26 2019, 11:57:09)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-39)]
--- test using prefix_chars='-/' with ArgumentParser
--- show help info
usage: test-1 [-h] [-foo FOO] [/bar BAR]

optional arguments:
  -h, --help  show this help message and exit
  -foo FOO
  /bar BAR

--- try parsing something
Namespace(bar='b', foo='f')
--- test using prefix_chars='-/' with an argument group
--- show help info
usage: test-2 [-h] [-foo FOO] [/bar BAR]

optional arguments:
  -h, --help  show this help message and exit

other arguments:
  -foo FOO
  /bar BAR

--- try parsing something
usage: test-2 [-h] [-foo FOO] [/bar BAR]
test-2: error: unrecognized arguments: /bar b
History
Date User Action Args
2021-10-28 18:27:12samwysesetrecipients: + samwyse
2021-10-28 18:27:12samwysesetmessageid: <1635445632.13.0.297943907791.issue45656@roundup.psfhosted.org>
2021-10-28 18:27:12samwyselinkissue45656 messages
2021-10-28 18:27:12samwysecreate