python-trio fails to build with Python 3.14.05. ________________ test_ki_protection_doesnt_leave_cyclic_garbage ________________ @pytest.mark.skipif( sys.implementation.name != "cpython", reason="Only makes sense with refcounting GC", ) async def test_ki_protection_doesnt_leave_cyclic_garbage() -> None: class MyException(Exception): pass async def demo() -> None: async def handle_error() -> None: try: raise MyException except MyException as e: exceptions.append(e) exceptions: list[MyException] = [] try: async with _core.open_nursery() as n: n.start_soon(handle_error) raise ExceptionGroup("errors", exceptions) finally: exceptions = [] exc: Exception | None = None try: await demo() except ExceptionGroup as excs: exc = excs.exceptions[0] assert isinstance(exc, MyException) > assert gc.get_referrers(exc) == no_other_refs() E assert [<coroutine o...7fbaa2f162c0>] == [] E E Left contains one more item: <coroutine object test_ki_protection_doesnt_leave_cyclic_garbage at 0x7fbaa2f162c0> E E Full diff: E - [] E + [ E + <coroutine object test_ki_protection_doesnt_leave_cyclic_garbage at 0x7fbaa2f162c0>, E + ] https://docs.python.org/3.14/whatsnew/3.14.html For the build logs, see: https://copr-be.cloud.fedoraproject.org/results/@python/python3.14/fedora-rawhide-x86_64/08651119-python-trio/ For all our attempts to build python-trio with Python 3.14, see: https://copr.fedorainfracloud.org/coprs/g/python/python3.14/package/python-trio/ Testing and mass rebuild of packages is happening in copr. You can follow these instructions to test locally in mock if your package builds with Python 3.14: https://copr.fedorainfracloud.org/coprs/g/python/python3.14/ Let us know here if you have any questions. Python 3.14 is planned to be included in Fedora 43. To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.14. A build failure prevents us from testing all dependent packages (transitive [Build]Requires), so if this package is required a lot, it's important for us to get it fixed soon. We'd appreciate help from the people who know this package best, but if you don't want to work on this now, let us know so we can try to work around it on our side.
Reproduced in a virtualenv and reported upstream: https://github.com/python-trio/trio/issues/3209
This appears to be caused by https://github.com/python/cpython/issues/125603.
A proposed fix exists in https://github.com/python/cpython/pull/125640, so this may be solved upstream in CPython before 3.14.0 final.
Assigning this to myself since Iām now keeping an eye on the CPython issue.
Upon reflection, I think it would make sense to skip this test on Python 3.14 for the time being, since it seems clear that the issue is in CPython and that it is breaking the *test*, not the *implementation*. https://src.fedoraproject.org/rpms/python-trio/pull-request/10