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 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:26Laszlo.Attila.Tothsetrecipients: + Laszlo.Attila.Toth, bethard, kalt
2013-02-02 11:54:26Laszlo.Attila.Tothsetmessageid: <1359806066.37.0.823347202978.issue13966@psf.upfronthosting.co.za>
2013-02-02 11:54:26Laszlo.Attila.Tothlinkissue13966 messages
2013-02-02 11:54:26Laszlo.Attila.Tothcreate