[issue14894] distutils.LooseVersion fails to compare number and a word

Barry A. Warsaw report at bugs.python.org
Thu May 24 00:25:07 CEST 2012


Barry A. Warsaw <barry at python.org> added the comment:

On May 23, 2012, at 10:13 PM, Éric Araujo wrote:

>
>Thanks for the report.  How did you find this?  According to the doc of
>LooseVersion, 'a' is not valid, so I would like a real example to accept this
>as a bug.

It works in Python 2.7 so I think it was viewed as a regression.

Python 2.7.3 (default, Apr 20 2012, 22:39:59) 
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from distutils.version import LooseVersion as v
>>> v('a') < v('0')
False

But if 'a' is invalid, then LooseVersion should refuse to accept it in its
constructor, right?

----------

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


More information about the Python-bugs-list mailing list