[issue4640] optparse - dosn't distinguish between '--option' and '-option'

R. David Murray report at bugs.python.org
Sat Jun 26 02:02:57 CEST 2010


R. David Murray <rdmurray at bitdance.com> added the comment:

I thought the OP might be saying that -debug didn't throw an error in 2.6.  test_optparse doesn't seem to have a test for this, so I wrote one.  But as far as I can see the correct error (invalid option -e, given that 'd' is defined) is thrown.  In 2.5, as well.

Rereading the initial post I understand the problem: his 'd' option takes an argument.  So 'ebug' becomes the option value, and thus no error is thrown.  Which is working as designed (that's how single letter options that take arguments usually work in Unix)

So, it is correct that this is not a bug.

----------
nosy: +r.david.murray

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue4640>
_______________________________________


More information about the Python-bugs-list mailing list