We're definitely using the system packages for mod_wsgi (and for
Python). Ubuntu 24.04's Python is '3.12.3', and I've used lsof to verify
that the relevant Apache process has the right Python shared library
loaded; it is using '/usr/lib/x86_64-linux-gnu/libpython3.12.so.1.0'
(Ubuntu package 'libpython3.12t64', also 3.12.3), and is also using the
system mod_wsgi, '/usr/lib/apache2/modules/mod_wsgi.so-3.12'.
(Ubuntu 24.04's Apache is '2.4.58', possibly plus Ubuntu patches.)
As GODJonez notes, 'list' doesn't normally have a __str__ method;
instead it usually comes from 'object'. The Ubuntu 24.04 normal python3
binary behaves properly, with 'list.__str__' reporting:
<slot wrapper '__str__' of 'object' objects>
Within the mod_wsgi environment, 'list.__str__' is:
<slot wrapper '__str__' of 'list' objects>
(basically as expected), which as GODJonez notes explains the problem.
I built the extremely simple 'embedding Python in another application'
example from
https://docs.python.org/3/extending/embedding.html and
linked it against the same libpython3.12.so.1.0 just to check, and it
reports that list.__str__ comes from 'object' as expected.
- cks