Issue 23348: distutils.LooseVersion fails to compare two valid versions (original) (raw)

Issue23348

Created on 2015-01-29 14:42 by maethor, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (4)
msg234975 - (view) Author: Guillaume (maethor) Date: 2015-01-29 14:42
$ 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 "", line 1, in 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.
msg235039 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2015-01-30 16:06
Thanks for the report. I think there’s already a long discussion in another ticket but don’t have time to search right now.
msg235043 - (view) Author: Guillaume (maethor) Date: 2015-01-30 17:27
Do you mean http://bugs.python.org/issue14894 ?
msg235054 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2015-01-30 21:15
Yes, thanks. Please weigh in on the other ticket.
History
Date User Action Args
2022-04-11 14:58:12 admin set github: 67537
2015-01-30 21:15:48 eric.araujo set status: open -> closedsuperseder: distutils.LooseVersion fails to compare number and a wordmessages: +
2015-01-30 17:27:24 maethor set messages: +
2015-01-30 16:06:32 eric.araujo set resolution: duplicatemessages: +
2015-01-29 15:02:04 vstinner set nosy: + vstinner
2015-01-29 14:42:00 maethor create