Your message dated Sun, 27 Sep 2026 17:19:44 +0000
with message-id <[email protected]>
and subject line Bug#1144533: fixed in dbus-python 1.5.0-1
has caused the Debian Bug report #1144533,
regarding dbus-python: Unimportable module when building in Python 3.15
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
1144533: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1144533
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: src:dbus-python
Version: 1.4.0-1
User: [email protected]
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 /\/\ /\ >< `/
From: Maximiliano Curia <[email protected]>
Date: Sat, 16 Aug 2026 12:00:00 +0200
Subject: Don't use Py_TPFLAGS_MANAGED_WEAKREF on types without
 Py_TPFLAGS_HAVE_GC

Revert ebecd174 plus regression test.

Forwarded: no
Last-Update: 2026-08-16
---
Index: dbus-python/dbus_bindings/conn-internal.h
===================================================================
--- dbus-python.orig/dbus_bindings/conn-internal.h
+++ dbus-python/dbus_bindings/conn-internal.h
@@ -42,10 +42,8 @@ typedef struct {
      */
     PyObject *object_paths;
 
-#if !DBUSPY_PY_VERSION_AT_LEAST(3, 12, 0, 0)
     /* Weak-references list to make Connections weakly referenceable */
     PyObject *weaklist;
-#endif
 
     dbus_bool_t has_mainloop;
 } Connection;
Index: dbus-python/dbus_bindings/conn.c
===================================================================
--- dbus-python.orig/dbus_bindings/conn.c
+++ dbus-python/dbus_bindings/conn.c
@@ -238,9 +238,7 @@ DBusPyConnection_NewConsumingDBusConnect
     self->has_mainloop = (mainloop != Py_None);
     self->conn = NULL;
     self->filters = PyList_New(0);
-#if !DBUSPY_PY_VERSION_AT_LEAST(3, 12, 0, 0)
     self->weaklist = NULL;
-#endif
     if (!self->filters) goto err;
     self->object_paths = PyDict_New();
     if (!self->object_paths) goto err;
@@ -394,10 +392,7 @@ static void Connection_tp_dealloc(Connec
     /* avoid clobbering any pending exception */
     PyErr_Fetch(&et, &ev, &etb);
 
-#if !DBUSPY_PY_VERSION_AT_LEAST(3, 12, 0, 0)
-    if (self->weaklist)
-#endif
-    {
+    if (self->weaklist) {
         PyObject_ClearWeakRefs((PyObject *)self);
     }
 
@@ -460,19 +455,12 @@ PyTypeObject DBusPyConnection_Type = {
     0,                      /*tp_getattro*/
     0,                      /*tp_setattro*/
     0,                      /*tp_as_buffer*/
-#if DBUSPY_PY_VERSION_AT_LEAST(3, 12, 0, 0)
-    Py_TPFLAGS_MANAGED_WEAKREF |
-#endif
     Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
     Connection_tp_doc,      /*tp_doc*/
     0,                      /*tp_traverse*/
     0,                      /*tp_clear*/
     0,                      /*tp_richcompare*/
-#if DBUSPY_PY_VERSION_AT_LEAST(3, 12, 0, 0)
-    0,                      /*tp_weaklistoffset*/
-#else
     offsetof(Connection, weaklist),   /*tp_weaklistoffset*/
-#endif
     0,                      /*tp_iter*/
     0,                      /*tp_iternext*/
     DBusPyConnection_tp_methods,  /*tp_methods*/
Index: dbus-python/dbus_bindings/server.c
===================================================================
--- dbus-python.orig/dbus_bindings/server.c
+++ dbus-python/dbus_bindings/server.c
@@ -38,10 +38,8 @@ typedef struct {
     /* The Connection subtype for which this Server is a factory */
     PyObject *conn_class;
 
-#if !DBUSPY_PY_VERSION_AT_LEAST(3, 12, 0, 0)
     /* Weak-references list to make server weakly referenceable */
     PyObject *weaklist;
-#endif
 
     PyObject *mainloop;
 } Server;
@@ -425,9 +423,7 @@ Server_tp_new(PyTypeObject *cls, PyObjec
         return NULL;
     }
 
-#if !DBUSPY_PY_VERSION_AT_LEAST(3, 12, 0, 0)
     ((Server *)self)->weaklist = NULL;
-#endif
     TRACE(self);
 
     return self;
@@ -442,10 +438,7 @@ static void Server_tp_dealloc(Server *se
     /* avoid clobbering any pending exception */
     PyErr_Fetch(&et, &ev, &etb);
 
-#if !DBUSPY_PY_VERSION_AT_LEAST(3, 12, 0, 0)
-    if (self->weaklist)
-#endif
-    {
+    if (self->weaklist) {
         PyObject_ClearWeakRefs((PyObject *)self);
     }
 
@@ -577,19 +570,12 @@ PyTypeObject DBusPyServer_Type = {
     0,                      /*tp_getattro*/
     0,                      /*tp_setattro*/
     0,                      /*tp_as_buffer*/
-#if DBUSPY_PY_VERSION_AT_LEAST(3, 12, 0, 0)
-    Py_TPFLAGS_MANAGED_WEAKREF |
-#endif
     Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
     Server_tp_doc,          /*tp_doc*/
     0,                      /*tp_traverse*/
     0,                      /*tp_clear*/
     0,                      /*tp_richcompare*/
-#if DBUSPY_PY_VERSION_AT_LEAST(3, 12, 0, 0)
-    0,                      /*tp_weaklistoffset*/
-#else
     offsetof(Server, weaklist),   /*tp_weaklistoffset*/
-#endif
     0,                      /*tp_iter*/
     0,                      /*tp_iternext*/
     DBusPyServer_tp_methods,/*tp_methods*/
Index: dbus-python/test/test-client.py
===================================================================
--- dbus-python.orig/test/test-client.py
+++ dbus-python/test/test-client.py
@@ -110,6 +110,22 @@ class TestDBusBindings(unittest.TestCase
         del bus
         self.assertTrue(ref() is None)
 
+    def testWeakRefsToBaseConnection(self):
+        # dbus.SessionBus() is a Python subclass, which always has
+        # Py_TPFLAGS_HAVE_GC; the C types do not, so they need their own
+        # coverage. Marking a non-GC type Py_TPFLAGS_MANAGED_WEAKREF makes
+        # CPython look for the weakref slot in the PyGC_Head that was never
+        # allocated, which reads and writes off the front of the object.
+        address = os.environ['DBUS_SESSION_BUS_ADDRESS']
+        conn = _dbus_bindings.Connection(address)
+        try:
+            ref = weakref.ref(conn)
+            self.assertTrue(ref() is conn)
+        finally:
+            conn.close()
+        del conn
+        self.assertTrue(ref() is None)
+
     def testInterfaceKeyword(self):
         #test dbus_interface parameter
         print(self.remote_object.Echo("dbus_interface on Proxy test Passed", 

Attachment: signature.asc
Description: PGP signature


--- End Message ---
--- Begin Message ---
Source: dbus-python
Source-Version: 1.5.0-1
Done: Simon McVittie <[email protected]>

We believe that the bug you reported is fixed in the latest version of
dbus-python, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Simon McVittie <[email protected]> (supplier of updated dbus-python package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Format: 1.8
Date: Sun, 27 Sep 2026 17:58:26 +0100
Source: dbus-python
Architecture: source
Version: 1.5.0-1
Distribution: unstable
Urgency: medium
Maintainer: Utopia Maintenance Team 
<[email protected]>
Changed-By: Simon McVittie <[email protected]>
Closes: 1039499 1144533
Changes:
 dbus-python (1.5.0-1) unstable; urgency=medium
 .
   * New upstream release
     - Works on Python 3.15 (Closes: #1144533)
   * Build with pybuild and mesonpy
   * d/control: Use debhelper compat level 14
     - Remove substvars that are now added automatically
   * d/control: Remove Rules-Requires-Root: no, default since Debian 13
   * d/control: Standards-Version: 4.7.4
     - No longer needs Priority: optional
   * d/control: python3-dbus-tests Recommends python3-tap (Closes: #1039499)
   * d/control, d/tests/control: Normalize formatting (debputy reformat)
   * d/upstream/metadata: Update Gitlab issue tracker URLs
   * d/watch: Update to v5 format
   * d/watch: Look for any supported archive extension, not just .tar.gz
   * d/watch: Also look for PEP-0625 name dbus_python-*.tar.*
   * Update lintian overrides
   * Remove files associated with binary packages that are no longer built
   * d/upstream/signing-key.asc: Update subkeys
   * d/copyright: Update
   * d/copyright: Don't quote the FSF's postal address here
   * d/gbp.conf: Merge upstream VCS tags
Checksums-Sha1:
 2b76214df44c9e1d56af30c59eacdb95e843b6fb 3334 dbus-python_1.5.0-1.dsc
 486069433ec5ba462abfe88af5e1046bda126b0f 203989 dbus-python_1.5.0.orig.tar.gz
 10520c0e3f9b8b4a37d82823b5d7bd20a6aedb71 833 dbus-python_1.5.0.orig.tar.gz.asc
 475b20ee834a5112186994d5642fa6df3fc15e31 30404 
dbus-python_1.5.0-1.debian.tar.xz
 101999ffc46b8a7c74b6820e0775f3a1a9497081 421776 dbus-python_1.5.0-1.git.tar.xz
 a69c6e22797a0daf879fb51143e4dc3a6d63e773 17740 
dbus-python_1.5.0-1_source.buildinfo
Checksums-Sha256:
 1669a2bdc67e30aba488134ca96ee0265831deef0277a73e8b7fa5d273ca7949 3334 
dbus-python_1.5.0-1.dsc
 ac94ce330879108e5d37105164cc14b595bdf9326d2ce4a5acad6c1ab2bf6476 203989 
dbus-python_1.5.0.orig.tar.gz
 a7dac5ffac4eca1224e7c8f7f417d7a36b797229974468030a23e5e684c51803 833 
dbus-python_1.5.0.orig.tar.gz.asc
 20d8a259f21a95c35c2fe79527f93b5772b09138879eebb8b1b53dfdcc4f5814 30404 
dbus-python_1.5.0-1.debian.tar.xz
 e4f209935165854194c4f5af732ecc03cba10f5f8e59c95638afbae937a1bc44 421776 
dbus-python_1.5.0-1.git.tar.xz
 e316bbca838beb58fb91d94a6018c14e5980b824356b43890ca4ab4c71e2f68f 17740 
dbus-python_1.5.0-1_source.buildinfo
Files:
 4044056a9933a3fc3c94b1b6c1aeaaa0 3334 devel optional dbus-python_1.5.0-1.dsc
 6c2b06c6c0d2bfd5a03c3fafafedcf09 203989 devel optional 
dbus-python_1.5.0.orig.tar.gz
 b79beaaff872c0441f21372f56878139 833 devel optional 
dbus-python_1.5.0.orig.tar.gz.asc
 5b32bee7420ab11ade377831a66f29e4 30404 devel optional 
dbus-python_1.5.0-1.debian.tar.xz
 1763c7ccf02d0216af68b1bd7219842d 421776 devel None 
dbus-python_1.5.0-1.git.tar.xz
 8060cf6c9d1592613758821435358bec 17740 devel optional 
dbus-python_1.5.0-1_source.buildinfo
Git-Tag-Info: tag=1a87fdd4d969eefd8921f4589611c768f7eaf752 
fp=7a073ad1ae694fa25bff62e5235c099d3eb33076
Git-Tag-Tagger: Simon McVittie <[email protected]>

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEN02M5NuW6cvUwJcqYG0ITkaDwHkFAmq5THIACgkQYG0ITkaD
wHmU8A/+Km6okBtHTzig9dGG5doAKrVgxazCg3UwA/03Z9fHsdxz9Ibqfz1+pwSu
u7ImZdBfS7NTmP7deKN1EGgMUwtpLqOSuvhKvt5lkeCLzB7NyvKeMzDtH4cCwV/K
ndN89ddDONsVQ+EPNVAtQOfQrYT4QtbKWAYqdLYNzy0DGEN3VmnagkAtSrWakZ06
CxCpxItc5GGrg6iVSA9XKsM8w0ZbE/Mbg/vLCjG2gJdLR7ocK7QYUL2l1+gbAYVp
ccSX9+patff/koeYfNxrcr3lgzs/OIScu2mg6Z4l1H2abQVo/X9Asv+R0ro2Kgxf
6gU1xyiMbYbq4R+M9SknoCWxCqjLwaidGX56BIQrjDADMNbUjvwfneQ9xQFo43uN
RDUW2S9wuPj58HYI3TiQ/TuVAxi9dfnhIkMQVTp7vbo5mqOG/Ehsk5/bGSaHPgLy
FthjGhEX91BEePh+LU01hwKPPubbPC3NdeP/7FRjZ8Sm6OXhpKlpWeq7XOZCiDBu
8bOSKJ84oEDf/z5cl6paPd377/66UYvo1yNHfw5v7Fc6tjSjIgqCY6yPWf6DXgGg
HQd9ngb9EZsQA574HMOaMYoRUCAkx6p2JJJnJJjLniKAgwkLg07JclQXn8HQ2lZP
byzq4VrHcgS+1gdrebxlg3i/JvIaPMxv33Jc4KWxVQZ7yQKTVGU=
=w3Zb
-----END PGP SIGNATURE-----

Attachment: pgpWvefK8_Y20.pgp
Description: PGP signature


--- End Message ---

Reply via email to