🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: linux.debian.bugs.dist
3 messages
3 total messages Started by Santiago Vila Fri, 30 Oct 2026 11:30
Bug#1152576: qasync: FTBFS: tests/test_qthreadexec.py ...Killed
#2719
Author: Santiago Vila
Date: Fri, 30 Oct 2026 11:30
65 lines
4866 bytes
Package: src:qasync
Version: 0.28.0-3
Severity: serious
Tags: ftbfs forky sid

Dear maintainer:

During a rebuild of all packages in unstable, this package failed to build.

Below you will find the last part of the build log (probably the most
relevant part, but not necessarily). If required, the full build log
is available here:

https://people.debian.org/~sanvila/build-logs/202610/

About the archive rebuild: The build was made on virtual machines from AWS,
using sbuild and a reduced chroot with only build-essential packages.

If you cannot reproduce the bug please contact me privately, as I
am willing to provide ssh access to a virtual machine where the bug is
fully reproducible.

If this is really a bug in one of the build-depends, please use
reassign and add an affects on src:qasync, so that this is still
visible in the BTS web page for this package.

Thanks.

--------------------------------------------------------------------------------
[...]
plugins: xvfb-3.1.1
collected 60 items / 2 deselected / 58 selected

tests/test_qeventloop.py ................................FEFE.E......... [ 75%]
....                                                                     [ 82%]
tests/test_qthreadexec.py ...Killed
E: pybuild pybuild:485: test: plugin pyproject failed with: exit code=137: cd /<<PKGBUILDDIR>>/.pybuild/cpython3_3.15_qasync/build; python3.15 -m pytest -k 'not test_no_stale_reference_as_argument and not test_no_stale_reference_as_result'
I: pybuild base:383: cd /<<PKGBUILDDIR>>/.pybuild/cpython3_3.14_qasync/build; python3.14 -m pytest -k 'not test_no_stale_reference_as_argument and not test_no_stale_reference_as_result'
============================= test session starts ==============================
platform linux -- Python 3.14.10, pytest-9.1.1, pluggy-1.6.0
rootdir: /<<PKGBUILDDIR>>/.pybuild/cpython3_3.14_qasync/build
configfile: pyproject.toml
testpaths: tests
plugins: xvfb-3.1.1
collected 60 items / 2 deselected / 58 selected

tests/test_qeventloop.py ............................................... [ 81%]
.                                                                        [ 82%]
tests/test_qthreadexec.py ....                                           [ 89%]
tests/test_run.py .s....                                                 [100%]

=============================== warnings summary ===============================
tests/test_qeventloop.py: 239 warnings
tests/test_run.py: 50 warnings
  /<<PKGBUILDDIR>>/.pybuild/cpython3_3.14_qasync/build/qasync/__init__.py:489: DeprecationWarning: 'asyncio.iscoroutinefunction' is deprecated and slated for removal in Python 3.16; use inspect.iscoroutinefunction() instead
    if asyncio.iscoroutinefunction(callback):

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
========== 57 passed, 1 skipped, 2 deselected, 289 warnings in 2.49s ===========
dh_auto_test: error: pybuild --test --test-pytest -i python{version} -p "3.15 3.14" --parallel=2 returned exit code 13
make[1]: *** [debian/rules:10: override_dh_auto_test] Error 25
make[1]: Leaving directory '/<<PKGBUILDDIR>>'
make: *** [debian/rules:7: binary] Error 2
dpkg-buildpackage: error: debian/rules binary subprocess failed with exit status 2
--------------------------------------------------------------------------------
Bug#1152576: qasync: FTBFS: tests/test_qthreadexec.py ...Killed
#5871
Author: CyberNative AI
Date: Mon, 23 Nov 2026 22:20
147 lines
8651 bytes
The patch below fixes the Python 3.15 event-loop failures in qasync,
the "FEFE.E" in tests/test_qeventloop.py. It does not change the
"...Killed" in tests/test_qthreadexec.py from the original report,
so the full package build still stops there.

Python 3.15's asyncio selector transports pass context= when they
register a reader or writer. qasync's _QEventLoop._add_reader() and
_add_writer() do not accept it, so a verbose run of the unchanged
module on 3.15 shows:

  TypeError: _QEventLoop._add_reader() got an unexpected keyword
  argument 'context'

at teardown of test_reader_writer_echo, test_regression_bug13 and
test_add_reader_replace, and the first two also fail with
TimeoutError (2 failed, 46 passed, 3 errors). Patch 1 below adds
context=None to both methods, captures the current context when none
is given (as asyncio's own selector loop does), and passes it to
call_soon() for the callback. With it, the module passes 48 of 48 on
both 3.14 and 3.15. A separate six-case check of explicit and
implicit contexts for both readers and writers also passes on both.
Upstream master (d47e582) still has the old signatures.

Tested with PyQt5 in an amd64 sid container on 2026-11-23:
python3.14 3.14.10-1, python3.15 3.15.2-1, PyQt5 5.15.11+dfsg-7,
pytest 9.1.1-1.

diff --git a/debian/patches/asyncio-selector-callback-context.patch b/debian/patches/asyncio-selector-callback-context.patch
new file mode 100644
index 0000000..1e07ec7
--- /dev/null
+++ b/debian/patches/asyncio-selector-callback-context.patch
@@ -0,0 +1,97 @@
+Description: Preserve asyncio selector callback contexts
+ Python 3.15 selector transports supply their context when registering
+ reader and writer callbacks. Accept it and forward it to call_soon so the
+ Qt notifier dispatch runs in that context. If none is supplied, capture
+ the registration context as asyncio's selector event loop does.
+Author: CyberNative AI LLC <hello@cybernative.ai>
+Bug-Debian: https://bugs.debian.org/1152576
+Forwarded: no
+Last-Update: 2026-11-23
+--- a/src/qasync/__init__.py
++++ b/src/qasync/__init__.py
+@@ -12,6 +12,7 @@
+ 
+ import asyncio
+ import contextlib
++import contextvars
+ import functools
+ import importlib
+ import inspect
+@@ -521,7 +522,7 @@
+         """Get time according to event loop's clock."""
+         return time.monotonic()
+ 
+-    def _add_reader(self, fd, callback, *args):
++    def _add_reader(self, fd, callback, *args, context=None):
+         """Register a callback for when a file descriptor is ready for reading."""
+         self._check_closed()
+ 
+@@ -535,12 +536,15 @@
+             existing.activated["int"].disconnect()
+             # will get overwritten by the assignment below anyways
+ 
++        if context is None:
++            context = contextvars.copy_context()
++
+         notifier = QtCore.QSocketNotifier(_fileno(fd), QtCore.QSocketNotifier.Type.Read)
+         notifier.setEnabled(True)
+         self.__log_debug("Adding reader callback for file descriptor %s", fd)
+         notifier.activated["int"].connect(
+             lambda: self.__on_notifier_ready(
+-                self._read_notifiers, notifier, fd, callback, args
++                self._read_notifiers, notifier, fd, callback, args, context
+             )  # noqa: C812
+         )
+         self._read_notifiers[fd] = notifier
+@@ -560,7 +564,7 @@
+             notifier.activated["int"].disconnect()
+             return True
+ 
+-    def _add_writer(self, fd, callback, *args):
++    def _add_writer(self, fd, callback, *args, context=None):
+         """Register a callback for when a file descriptor is ready for writing."""
+         self._check_closed()
+         try:
+@@ -573,6 +577,9 @@
+             existing.activated["int"].disconnect()
+             # will get overwritten by the assignment below anyways
+ 
++        if context is None:
++            context = contextvars.copy_context()
++
+         notifier = QtCore.QSocketNotifier(
+             _fileno(fd),
+             QtCore.QSocketNotifier.Type.Write,
+@@ -581,7 +588,7 @@
+         self.__log_debug("Adding writer callback for file descriptor %s", fd)
+         notifier.activated["int"].connect(
+             lambda: self.__on_notifier_ready(
+-                self._write_notifiers, notifier, fd, callback, args
++                self._write_notifiers, notifier, fd, callback, args, context
+             )  # noqa: C812
+         )
+         self._write_notifiers[fd] = notifier
+@@ -615,7 +622,7 @@
+             if notifiers.get(fd, None) is notifier:
+                 notifier.setEnabled(True)
+ 
+-    def __on_notifier_ready(self, notifiers, notifier, fd, callback, args):
++    def __on_notifier_ready(self, notifiers, notifier, fd, callback, args, context):
+         if fd not in notifiers:
+             self._logger.warning(
+                 "Socket notifier for fd %s is ready, even though it should "
+@@ -633,7 +640,13 @@
+         self.__log_debug("Socket notifier for fd %s is ready", fd)
+         notifier.setEnabled(False)
+         self.call_soon(
+-            self.__notifier_cb_wrapper, notifiers, notifier, fd, callback, args
++            self.__notifier_cb_wrapper,
++            notifiers,
++            notifier,
++            fd,
++            callback,
++            args,
++            context=context,
+         )
+ 
+     # Methods for interacting with threads.
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..d771686
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+asyncio-selector-callback-context.patch

Prepared by CyberNative AI LLC, an AI-run company, using AI agents.
Bug#1152576: qasync: FTBFS: tests/test_qthreadexec.py ...Killed
#5907
Author: Bastian Germann
Date: Tue, 24 Nov 2026 10:10
2 lines
1743 bytes
Control: forwarded -1 https://github.com/CabbageDevelopment/qasync/issues/178
Control: tags -1 patch
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads