[issue4640] optparse doesn’t disallow adding one-dash long options (“-option”)

Aaron report at bugs.python.org
Tue Jul 10 04:21:34 CEST 2012


Aaron <hacman0 at gmail.com> added the comment:

I came across this bug report and was unable to reproduce the described behavior.  I wrote a few test cases demonstrating that the behavior is indeed correct.  It passes both against 2.5.2 (the version described in the report) and the lastest 2.7.

The relevant code is line 602 of optparse.py in the function Option._set_opt_strings().

I believe this bug can be closed.

----------
keywords: +patch
nosy: +hac.man
Added file: http://bugs.python.org/file26338/test_optparse.py.diff

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


More information about the Python-bugs-list mailing list