[Pkg-utopia-maintainers] Bug#1144533: dbus-python: Unimportable module when building in Python 3.15

Maximiliano Curia maxy at debian.org
Sun Aug 16 14:25:57 BST 2026


Package: src:dbus-python
Version: 1.4.0-1
User: debian-python at lists.debian.org
Usertags: python3.15

Hi!

While rebuilding packages against Python 3.15 we found that dbus-python
failed to build from source due to failing tests. All the tests were
saying something like:

test:         dbus-python:standalone
start time:   10:20:31
duration:     0.05s
result:       exit status 1
command:      DBUS_TEST_TMPDIR=/build/reproducible-path/dbus-python-1.4.0/build-3.15/test DBUS_TOP_SRCDIR=/build/reproducible-path/dbus-python-1.4.0 DBUS_PYTHON_VERSION=1.4.0 MALLOC_PERTURB_=171 UBSAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1:print_stacktrace=1 PYTHONPATH=/build/reproducible-path/dbus-python-1.4.0:/build/reproducible-path/dbus-python-1.4.0/test:/build/reproducible-path/dbus-python-1.4.0/build-3.15:/build/reproducible-path/dbus-python-1.4.0/build-3.15/test MSAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1:print_stacktrace=1 ASAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1 DBUS_TEST_UNINSTALLED=1 DBUS_FATAL_WARNINGS=1 MESON_TEST_ITERATION=1 DBUS_TOP_BUILDDIR=/build/reproducible-path/dbus-python-1.4.0/build-3.15 /usr/bin/dbus-run-session --config-file /build/reproducible-path/dbus-python-1.4.0/build-3.15/test/tmp-session-bus.conf -- /usr/bin/python3.15 /build/reproducible-path/dbus-python-1.4.0/build-3.15/../test/test-standalone.py
----------------------------------- stderr -----------------------------------
Traceback (most recent call last):
   File "/build/reproducible-path/dbus-python-1.4.0/build-3.15/../test/test-standalone.py", line 39, in <module>
     import _dbus_bindings
SystemError: type _dbus_bindings.Connection has the Py_TPFLAGS_MANAGED_WEAKREF flag but not Py_TPFLAGS_HAVE_GC flag

The problem seems to be caused by the fact that the Connection is a
GenericAlloc that's missing the PyGC_Head header header, this is now detected in
Python 3.15 (see: https://github.com/python/cpython/issues/134786).

The weakref was introduced by ebecd174 but the previous mechanism still
works, so I'm reverting ebecd174 and adding a regression test that
should fail in python 3.12 to 3.14.

Happy hacking,
-- 
"Backtracking algorithms are nondeterministic, not in the sense of being 
random, but in the sense of having free will."
-- Robert W. Floyd
Saludos /\/\ /\ >< `/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: no-managed-weakref-without-gc.patch
Type: text/x-diff
Size: 5464 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/pkg-utopia-maintainers/attachments/20260816/30a07fbf/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/pkg-utopia-maintainers/attachments/20260816/30a07fbf/attachment.sig>


More information about the Pkg-utopia-maintainers mailing list