Message405217
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 |
|
Date |
User |
Action |
Args |
2021-10-28 18:27:12 | samwyse | set | recipients:
+ samwyse |
2021-10-28 18:27:12 | samwyse | set | messageid: <1635445632.13.0.297943907791.issue45656@roundup.psfhosted.org> |
2021-10-28 18:27:12 | samwyse | link | issue45656 messages |
2021-10-28 18:27:12 | samwyse | create | |
|