[New-bugs-announce] [issue23348] distutils.LooseVersion fails to compare two valid versions

Guillaume report at bugs.python.org
Thu Jan 29 15:42:00 CET 2015


New submission from Guillaume:

$ python2.7 -c "from distutils.version import LooseVersion as V; print V('3.16.0-0.bpo.4-amd64') > V('3.16-0.bpo.2-amd64')"
False
$ python3.4 -c "from distutils.version import LooseVersion as V; print(V('3.16.0-0.bpo.4-amd64') > V('3.16-0.bpo.2-amd64'))" 
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python3.4/distutils/version.py", line 70, in __gt__
    c = self._cmp(other)
  File "/usr/lib/python3.4/distutils/version.py", line 343, in _cmp
    if self.version < other.version:
TypeError: unorderable types: int() < str()

Same thing with python3.2 et python3.3.

I find this on Debian. They recently change the numerotation of backported kernels.

----------
components: Distutils
messages: 234975
nosy: dstufft, eric.araujo, maethor
priority: normal
severity: normal
status: open
title: distutils.LooseVersion fails to compare two valid versions
type: behavior
versions: Python 3.2, Python 3.3, Python 3.4

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


More information about the New-bugs-announce mailing list