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 paul.j3
Recipients Christophe.Guillon, abacabadabacaba, amcnabb, andersk, bethard, danielsh, davidben, drm, eric.araujo, eric.smith, gdb, gfxmonk, nelhage, paul.j3, r.david.murray, skilletaudio
Date 2013-03-14.17:09:23
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1363280964.04.0.502431739559.issue9334@psf.upfronthosting.co.za>
In-reply-to
Content
If nargs=2, type=float, an argv like '1e4 -.002' works, but '1e4 -2e-3' produces the same error as discussed here.  The problem is that _negative_number_matcher does not handle scientific notation.  The proposed generalize matcher, r'^-.+$', would solve this, but may be overkill.

I'm not as familiar with optparse and other argument processes, but I suspect argparse is different in that it processes the argument strings twice.  On one loop it parses them, producing an arg_strings_pattern that looks like 'OAA' (or 'OAO' in these problem cases).  On the second loop is consumes the strings (optionals and positionals).  This gives it more power, but produces problems like this if the parsing does not match expectations.
History
Date User Action Args
2013-03-14 17:09:24paul.j3setrecipients: + paul.j3, amcnabb, bethard, eric.smith, eric.araujo, r.david.murray, gfxmonk, andersk, abacabadabacaba, gdb, nelhage, drm, davidben, skilletaudio, Christophe.Guillon, danielsh
2013-03-14 17:09:24paul.j3setmessageid: <1363280964.04.0.502431739559.issue9334@psf.upfronthosting.co.za>
2013-03-14 17:09:24paul.j3linkissue9334 messages
2013-03-14 17:09:23paul.j3create