Public bug reported:

Ubuntu version: 24.04.1
Package version: 3.5.0.1-3build1
Python version: 3.12.3

I encountered this problem after upgrading from jammy -> nobel and
installing Trac 1.6. I do not believe this is a problem with Trac
however.

The trac.web.modpython_frontend handler supplied by Trac indirectly ends
up in platform._sys_version which requires sys.version to be of a
specific format: "X.Y.Z (buildno, builddate, buildtime) [compiler]", and
raises ValueError if it cannot be parsed.

However, setting the handler to mod_python.testhandler reveals that
sys.version is just "X.Y.X".

So the sys.version that is being set by mod_python is not compatible
with the standard python platform module.

The error that appears in the Apache log is:

...
File "/usr/lib/python3.12/platform.py", line 1108, in _sys_version ...
ValueError: failed to parse CPython sys.version: '3.12.3'

Adding this hack to the trac.web.modpython_frontend module resolves the
problem:

try:
    sys.version.index(" ")
except ValueError:
    sys.version += ' (dummy, dummy, dummy) [dummy]'

** Affects: libapache2-mod-python (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2078527

Title:
  sys.version from mod_python cannot be parsed by the python platform
  module

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/libapache2-mod-python/+bug/2078527/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to