From 63efa1bc6fa895724d15e2cba5a9cc97a6c50dac49c04b7c30f9343a13dfac44 Mon Sep 17 00:00:00 2001 From: Christophe Marin Date: Tue, 11 Jun 2024 10:15:46 +0000 Subject: [PATCH] Accepting request 1179965 from home:alarrosa:branches:devel:languages:python:pytest - Add patch to fix build of python-pytest-qt with test-pyside6 flavor, which fails the test_destroyed test with a SystemError exception: * fix-pytest-qt.patch OBS-URL: https://build.opensuse.org/request/show/1179965 OBS-URL: https://build.opensuse.org/package/show/KDE:Qt6/python3-pyside6?expand=0&rev=73 --- fix-pytest-qt.patch | 41 +++++++++++++++++++++++++++++++++++++++++ python3-pyside6.changes | 8 ++++++++ python3-pyside6.spec | 2 ++ 3 files changed, 51 insertions(+) create mode 100644 fix-pytest-qt.patch diff --git a/fix-pytest-qt.patch b/fix-pytest-qt.patch new file mode 100644 index 0000000..5c95ac1 --- /dev/null +++ b/fix-pytest-qt.patch @@ -0,0 +1,41 @@ +From: Antonio Larrosa +Subject: Fix for pytest-qt test_destroyed failure + +This fixes the issue in the python-pytest-qt package (test-pyside6 flavor) +that triggered the following failure: + +[ 90s] ________________________________ test_destroyed ________________________________ +[ 90s] CALL ERROR: Exceptions caught in Qt event loop: +[ 90s] ________________________________________________________________________________ +[ 90s] RuntimeError: Internal C++ object (Obj) already deleted. +[ 90s] +[ 90s] The above exception was the direct cause of the following exception: +[ 90s] +[ 90s] Traceback (most recent call last): +[ 90s] File "/usr/lib/python3.11/site-packages/pytestqt/wait_signal.py", line 219, in _quit_loop_by_signal +[ 90s] self._cleanup() +[ 90s] File "/usr/lib/python3.11/site-packages/pytestqt/wait_signal.py", line 226, in _cleanup +[ 90s] _silent_disconnect(signal, self._quit_loop_by_signal) +[ 90s] File "/usr/lib/python3.11/site-packages/pytestqt/wait_signal.py", line 741, in _silent_disconnect +[ 90s] signal.disconnect(slot) +[ 90s] SystemError: returned a result with an exception set + +This happened because PyObject_CallObject (or PyObject_GetAttr) was +setting an exception and warnDisconnectFailed was generating a new one +without the first one being processed yet. + +Submitted to upstream in https://codereview.qt-project.org/c/pyside/pyside-setup/+/567559 + +Index: pyside-setup-everywhere-src-6.7.1/sources/pyside6/libpyside/pysidesignal.cpp +=================================================================== +--- pyside-setup-everywhere-src-6.7.1.orig/sources/pyside6/libpyside/pysidesignal.cpp ++++ pyside-setup-everywhere-src-6.7.1/sources/pyside6/libpyside/pysidesignal.cpp +@@ -718,7 +718,7 @@ static PyObject *signalInstanceDisconnec + Shiboken::AutoDecRef pyMethod(PyObject_GetAttr(source->d->source, + PySide::PySideName::qtDisconnect())); + PyObject *result = PyObject_CallObject(pyMethod, tupleArgs); +- if (result != Py_True) ++ if (result && result != Py_True) + warnDisconnectFailed(slot, source->d->signature); + return result; + } diff --git a/python3-pyside6.changes b/python3-pyside6.changes index 9ca2f06..fdffe21 100644 --- a/python3-pyside6.changes +++ b/python3-pyside6.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Wed May 29 07:28:11 UTC 2024 - Antonio Larrosa + +- Add patch to fix build of python-pytest-qt with test-pyside6 + flavor, which fails the test_destroyed test with a SystemError + exception: + * fix-pytest-qt.patch + ------------------------------------------------------------------- Tue May 28 15:46:43 UTC 2024 - Christophe Marin diff --git a/python3-pyside6.spec b/python3-pyside6.spec index 20d19f8..73abe5f 100644 --- a/python3-pyside6.spec +++ b/python3-pyside6.spec @@ -53,6 +53,8 @@ Source: https://download.qt.io/official_releases/QtForPython/pyside6/PyS Patch0: 0001-Always-link-to-python-libraries.patch # PATCH-FIX-UPSTREAM Patch1: 0001-shiboken-add-missing-include.patch +# PATCH-FIX-UPSTREAM https://codereview.qt-project.org/c/pyside/pyside-setup/+/567559 +Patch2: fix-pytest-qt.patch # SECTION common_dependencies BuildRequires: clang-devel BuildRequires: %{mypython}-Sphinx