Message188250
When it goes to format a usage message, argparse seems to (correctly) fail to satisfy one of its assertions when all of the following are true:
1. A mutually exclusive group contains only args that are suppressed
2. An unsuppressed arg follows that group
3. The usage is long enough to need to line-wrap
The cause seems to be that the set of regular expressions that argparse uses to clean up mutually exclusive groups' separators doesn't handle the space that follows what would otherwise be an empty pair of square braces, sort of like this:
1. [-h] [ ] [--spam] ...
2. [-h] [] [--spam] ...
3. [-h] [--spam] ...
A test case is attached. I was able to reproduce this with python-2.7.3-13.fc18.x86_64 on Fedora as well as with commit 83588:e6b962fa44bb in 3.4 mainline. I have a small patch for the latter that I'll submit shortly.
Sorry if I missed anything. This is my first bug report against python proper. |
|
Date |
User |
Action |
Args |
2013-05-02 00:43:02 | gholms | set | recipients:
+ gholms |
2013-05-02 00:43:02 | gholms | set | messageid: <1367455382.45.0.0611766927148.issue17890@psf.upfronthosting.co.za> |
2013-05-02 00:43:02 | gholms | link | issue17890 messages |
2013-05-02 00:43:01 | gholms | create | |
|