Hello!
I came across this bug as I was writing up Ubuntu bug 2061929.
Unfortunately, python-docker 5.0.3-1 will break if Python3 moves to
3.12. There are at least two different issues:
• python-docker 5.0.3 relies on code from distutils, at runtime. The
workaround for this is to rewrite the code, or to instead rely on
python3-setuptools.
• python-docker uses the requests & urllib3 modules in ways that break
in newer versions. The breakage is in how the docker module talks to
local Docker daemons through a UNIX socket. The only way to resolve
this is a code change.
There may be other breakages with python-docker 5.x and Python 3.12; I
cannot say for certain.
I came across this with Ubuntu 24.04, because they moved python3 to
3.12. More details, along with possible patches, can be found in
https://bugs.launchpad.net/ubuntu/+source/python-docker/+bug/2061929
--
~ Karl Kornel