fix: add support for Python 3.14 - #196
Conversation
|
I have run the test locally with tox and it passes on Python 3.10, 3.12 and 3.14. I guess it’s failing on Ubuntu because until 3.14 is released, it’s 3.14-dev and not 3.14 that should be used. Should I enable with the |
|
just some comments from my side, actually, I want to move everything (txaio, autobahn-python, crossbar, ..) to uv: crossbario/autobahn-python#1665 - so this would mean latest cpython is 3.14.0b3: I have migrated my private Python project/repos already, but still didn't had time yet to get to txaio etc, even though crossbario/autobahn-python#1669 already is (mostly) just/uv.
|
Description
asyncio.get_event_loopnow fails if no event loop is active. See https://docs.python.org/3.14/library/asyncio-eventloop.html#asyncio.get_event_loop and the initial bug report Support python 3.14 #193 for more detailstoxmatrix.Related Issue(s)
Closes or relates to #193
Checklist
my feature works
AI Assistance Disclosure
Created the relevant file in
.audit.Review of the proposed Python 3.14 compatibility fix
Reviewed by: GitHub Copilot (on behalf of @oberstet) See #193 (comment) for the original comment.
The patch (commit) correctly addresses Python 3.14 compatibility by adding a fallback when
asyncio.get_event_loop()raises aRuntimeError. If no event loop is running, it creates a new one and sets it. This pattern is now used in both the test utility code and intxaio/aio.py.This approach is:
Summary:
This fix is a robust way to support Python 3.14 and maintain compatibility with older Python versions.