Message172088
| Author |
idank |
| Recipients |
idank |
| Date |
2012年10月05日.14:53:20 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1349448801.58.0.783623579173.issue16142@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
When known and unknown options are given together in the same option string (e.g. -xy) then ArgumentParser behaves in a strange way:
- if the known option is given first (so -k is known and the parser is fed with ['-ku']) then the parsing aborts with "error: argument -k/--known: ignored explicit argument 'u'"
- if the unknown option is given first then both options are treated as unknown and returned in the list of remaining arguments.
This makes it impossible to use parse_known_args for its intended purpose because every single letter option might be interleaved with other unknown options.
I attached a test script that demonstrates this. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2012年10月05日 14:53:21 | idank | set | recipients:
+ idank |
| 2012年10月05日 14:53:21 | idank | set | messageid: <1349448801.58.0.783623579173.issue16142@psf.upfronthosting.co.za> |
| 2012年10月05日 14:53:21 | idank | link | issue16142 messages |
| 2012年10月05日 14:53:20 | idank | create |
|