Message181164
| Author |
Laszlo.Attila.Toth |
| Recipients |
Laszlo.Attila.Toth, bethard, kalt |
| Date |
2013年02月02日.11:54:26 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1359806066.37.0.823347202978.issue13966@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
Unfortunatelly the implementation bugous as of now. I wrote additional tests.
self.parser = ErrorRaisingArgumentParser()
self.parser.add_argument('-a', action='store_true')
self.parser.add_argument('-b')
self.parser.add_argument('rem', nargs=argparse.REMAINDER)
self.assertEquals(self.parser.parse_args('-b 4 -a -b 5'.split()), NS(a=True, b='5', rem=[]))
This part is OK. But with the new option:
self.parser.disable_interspersed_args()
self.assertEquals(self.parser.parse_args('-b 4 -a -b 5'.split()), NS(a=False, b='4', rem=['-a', '-b', '5']))
This assertation also passes because it contains the actual result, which is unexpected. This is because the code doesn't handle properly the arguments that are non-options, such as '-b' in this case.
I can't see a good solution for this. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2013年02月02日 11:54:26 | Laszlo.Attila.Toth | set | recipients:
+ Laszlo.Attila.Toth, bethard, kalt |
| 2013年02月02日 11:54:26 | Laszlo.Attila.Toth | set | messageid: <1359806066.37.0.823347202978.issue13966@psf.upfronthosting.co.za> |
| 2013年02月02日 11:54:26 | Laszlo.Attila.Toth | link | issue13966 messages |
| 2013年02月02日 11:54:26 | Laszlo.Attila.Toth | create |
|