Comment 2 for bug 1967139

Revision history for this message
Heinrich Schuchardt (xypron) wrote :

Package python3-cheroot has version 8.5.2+ds1-1ubuntu.

src/pybind/mgr/dashboard/cherrypy_backports.py:124:
from distutils.version import StrictVersion
if v < StrictVersion("9.0.0") or cheroot_version < StrictVersion("6.5.5"):

>>> StrictVersion("8.5.2+ds1-1ubuntu")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.10/distutils/version.py", line 40, in __init__
    self.parse(vstring)
  File "/usr/lib/python3.10/distutils/version.py", line 137, in parse
    raise ValueError("invalid version number '%s'" % vstring)
ValueError: invalid version number '8.5.2+ds1-1ubuntu'

The regular expression to check version numbers is
r'(?x)^(\d+)\.(\d+)(\.(\d+))?([ab](\d+))?$'

Allowable package versions are defined in PEP440 (https://peps.python.org/pep-0440/) as
[N!]N(.N)*[{a|b|rc}N][.postN][.devN]

So both the test in the deprecated distutils package as well as the version number reported by package python3-cheroot is wrong.