Your message dated Sun, 23 Aug 2026 21:53:33 +0000
with message-id <[email protected]>
and subject line Bug#1144994: fixed in pyqt5 5.15.11+dfsg-6
has caused the Debian Bug report #1144994,
regarding pyqt5: FTBFS building against 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.)


-- 
1144994: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1144994
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: src:pyqt5
Version: 5.15.11+dfsg-5
User: [email protected]
Usertags: python3.15
Tags: patch

Hi!

While rebuilding the python related packages against the python version
3.15rc1 we found that pyqt5 fails to build from source[1]. This is due
to the removal of PyWeakref_GetObject which was deprecated in python
3.13. I'm attaching a patch that's almost identical to the one needed
for pyqt6.

Please consider applying this or a similar patch in your next upload.

Happy hacking,

[1]: 
https://debusine.debian.net/debian/r-python-python3.15/work-request/1017822/
--
"Can you imagine what I would do if I could do all I can?" -- Sun Tzu
Saludos /\/\ /\ >< `/
Description: Fix build against Python 3.15 by using PyWeakref_GetRef
 PyWeakref_GetObject was deprecated in Python 3.13 and removed in Python 3.15.
 Replace its usage with PyWeakref_GetRef, properly handling strong references
 and providing a compatibility fallback for older Python versions and limited API.
Author: Maximiliano Curia <[email protected]>
Forwarded: no
Last-Update: 2026-08-19

Index: pyqt5/qpy/QtCore/qpycore_pyqtslot.cpp
===================================================================
--- pyqt5.orig/qpy/QtCore/qpycore_pyqtslot.cpp
+++ pyqt5/qpy/QtCore/qpycore_pyqtslot.cpp
@@ -24,6 +24,40 @@
 #include "qpycore_pyqtslot.h"
 
 
+#if PY_VERSION_HEX < 0x030D0000
+static inline int PyWeakref_GetRef(PyObject *ref, PyObject **pobj)
+{
+    PyObject *obj;
+
+    if (ref != NULL && !PyWeakref_Check(ref))
+    {
+        *pobj = NULL;
+        PyErr_SetString(PyExc_TypeError, "expected a weakref");
+        return -1;
+    }
+
+    obj = PyWeakref_GetObject(ref);
+    if (obj == NULL)
+    {
+        *pobj = NULL;
+        return -1;
+    }
+
+    if (obj == Py_None)
+    {
+        *pobj = NULL;
+        return 0;
+    }
+
+    Py_INCREF(obj);
+    *pobj = obj;
+    return 1;
+}
+#elif defined(Py_LIMITED_API) && Py_LIMITED_API < 0x030D0000
+extern "C" PyAPI_FUNC(int) PyWeakref_GetRef(PyObject *ref, PyObject **pobj);
+#endif
+
+
 // Create the slot for an unbound method.
 PyQtSlot::PyQtSlot(PyObject *method, PyObject *type,
         const Chimera::Signature *slot_signature)
@@ -54,6 +88,8 @@ PyQtSlot::PyQtSlot(PyObject *callable, c
 
         // Try and create a weak reference to the instance object.
         mself_wr = PyWeakref_NewRef(mself, 0);
+        if (!mself_wr)
+            PyErr_Clear();
     }
     else
     {
@@ -100,9 +136,11 @@ PyQtSlot::Result PyQtSlot::invoke(void *
     }
     else
     {
+        PyObject *self_ref = 0;
+
         // Use the value we have if one wasn't supplied.
         if (!self)
-            self = instance();
+            self = self_ref = instance();
 
         // If self is NULL then we didn't have a method in the first place.
         // Instead we had a callable that has been cleared during garbage
@@ -112,12 +150,18 @@ PyQtSlot::Result PyQtSlot::invoke(void *
 
         // See if the instance has gone (which isn't an error).
         if (self == Py_None)
+        {
+            Py_XDECREF(self_ref);
             return PyQtSlot::Ignored;
+        }
 
         // If the receiver wraps a C++ object then ignore the call if it no
         // longer exists.
         if (!no_receiver_check && PyObject_TypeCheck(self, sipSimpleWrapper_Type) && !sipGetAddress((sipSimpleWrapper *)self))
+        {
+            Py_XDECREF(self_ref);
             return PyQtSlot::Ignored;
+        }
 
         sipMethodDef callable_m;
 
@@ -128,6 +172,8 @@ PyQtSlot::Result PyQtSlot::invoke(void *
 #endif
 
         callable = sipFromMethod(&callable_m);
+
+        Py_XDECREF(self_ref);
     }
 
     // Convert the C++ arguments to Python objects.
@@ -188,12 +234,17 @@ bool PyQtSlot::operator==(PyObject *call
         if (other)
             return false;
 
-        return (mfunc == callable_m.pm_function
-                && instance() == callable_m.pm_self
+        PyObject *self = instance();
+        bool match = (mfunc == callable_m.pm_function
+                && self == callable_m.pm_self
 #if PY_MAJOR_VERSION < 3
                 && mclass == callable_m.pm_class
 #endif
                 );
+
+        Py_XDECREF(self);
+
+        return match;
     }
 
     if (!other)
@@ -219,8 +270,19 @@ PyObject *PyQtSlot::instance() const
 {
     // Use the weak reference if possible.
     if (mself_wr)
-        return PyWeakref_GetObject(mself_wr);
+    {
+        PyObject *obj = 0;
+
+        if (PyWeakref_GetRef(mself_wr, &obj) < 0)
+        {
+            PyErr_Clear();
+            return 0;
+        }
+
+        return obj;
+    }
 
+    Py_XINCREF(mself);
     return mself;
 }
 

--- End Message ---
--- Begin Message ---
Source: pyqt5
Source-Version: 5.15.11+dfsg-6
Done: Dmitry Shachnev <[email protected]>

We believe that the bug you reported is fixed in the latest version of
pyqt5, 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.
Dmitry Shachnev <[email protected]> (supplier of updated pyqt5 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: Mon, 24 Aug 2026 00:28:42 +0300
Source: pyqt5
Architecture: source
Version: 5.15.11+dfsg-6
Distribution: unstable
Urgency: medium
Maintainer: Debian Python Team <[email protected]>
Changed-By: Dmitry Shachnev <[email protected]>
Closes: 1144994
Changes:
 pyqt5 (5.15.11+dfsg-6) unstable; urgency=medium
 .
   * Backport upstream patch to support Python 3.15 (closes: #1144994).
   * Update extension suffixes for SIP 6.16.1.
   * Update to debhelper compat level 14.
     - Remove explicit ${*:Depends} declarations.
   * Override ‘pyqt5-dev: python-package-missing-depends-on-python’ error.
Checksums-Sha1:
 28d3bf66284d7ce2028c8c350c81002f8f285d41 3490 pyqt5_5.15.11+dfsg-6.dsc
 b0adf8ffa035d6b32d1a54ad95e91adef27edeb9 18864 
pyqt5_5.15.11+dfsg-6.debian.tar.xz
 dd7954227080cc98e7753782b3919e1c162e059c 15644 
pyqt5_5.15.11+dfsg-6_source.buildinfo
Checksums-Sha256:
 b9cf5cf6dc0341515069cd5058bff3d6507e1762393eda88cb77b94c0d075a7e 3490 
pyqt5_5.15.11+dfsg-6.dsc
 2e267fa020c7fdd5c463f461e36aa855980d8eb51a625c5107d4d166679126fd 18864 
pyqt5_5.15.11+dfsg-6.debian.tar.xz
 3ee6337fd946afa7c2ac422a297c9a1cd37d9109f6be6b740c119062afc8a9f1 15644 
pyqt5_5.15.11+dfsg-6_source.buildinfo
Files:
 6e74e22081c9145c901463a8fa69aa89 3490 python optional pyqt5_5.15.11+dfsg-6.dsc
 f978f4d69d7e265474e89a8c6efc11ad 18864 python optional 
pyqt5_5.15.11+dfsg-6.debian.tar.xz
 bf0e57a73970e813c2dedb4406d7f020 15644 python optional 
pyqt5_5.15.11+dfsg-6_source.buildinfo

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

iQJHBAEBCgAxFiEE8kKZ/xu8kBi5BqTLYCaTbS8ciuAFAmqLZpETHG1pdHlhNTdA
ZGViaWFuLm9yZwAKCRBgJpNtLxyK4PnlEACaaaMgMtNmRRjdarlkGHzujKv19drZ
/2UVC/NwZFmkbnoM+U/5NNAteZPu0LSScOtfFjKMNJzLgKCRXMIwKhrucWUc1WDl
Q2HCGPRwDpTHEw0VP3lpY8rXXFsYGElBw1JlUpy3zZoQCjsIP4HmJICmzFnwvF9w
cRpm2tl1P35av815Qa/u/itJ1GLS+mM6Z5fFsFo5H0tJp+ZliEGJ+UNa3lYxlFZh
mDcm+yAlSnnA9mHLl574FNqGxY8PNTO/v8towSAj2NoQcoB6hWFvjTsgLJ8Ai2+F
45ns2wU/li9PxC5p5Rdt5Ako4ZSvMpZDWQkhQ2WNbcgx4VtllNkn4adIrHP5ru+k
i3BGkm9HBKf+gouLfZ64Z1x+Yqpa17Y7OgKTNUSB4bhhUeMzF6ZsUr3TH6gY2TsV
nq/71kpJbjKp0viYQ40AuCItX38jF8vPzEjGN518l2CPWvibabsjSA3SmUb0Aq2a
IGAP649mSjoNKJIWc7szvw9zcgm+be2i7f46fEQuh+C5czOxMbs3FNtr9vq0wBiQ
0T08XGBzLU3EjBmaZt+w4JK7QEp6GZRCtufoHo4rtO3E5TjacPery7eFuVb63/Tl
CfHWw1mEwWtN+Jqs7DGFzd+Uxb/g4yeTOs6V3S3bzL9GyDacJyGxUhsseYM2ZgQF
w3GbyizLBE1mtQ==
=AZcd
-----END PGP SIGNATURE-----

Attachment: pgp57oVGAYz39.pgp
Description: PGP signature


--- End Message ---

Reply via email to