server: Explicitly create asyncio event loop for python 3.14#57
Merged
SmithChart merged 1 commit intopengutronix:masterfrom Feb 26, 2026
Merged
server: Explicitly create asyncio event loop for python 3.14#57SmithChart merged 1 commit intopengutronix:masterfrom
SmithChart merged 1 commit intopengutronix:masterfrom
Conversation
Starting with python 3.14, asyncio.get_event_loop() "Raises a
RuntimeError if there is no current event loop." which we hit when
trying to run the server with 3.14.3:
File "flamingo/test-site/env/bin/flamingo", line 27, in <module>
runpy.run_path(scripts[args.command])
~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
File "<frozen runpy>", line 287, in run_path
File "<frozen runpy>", line 98, in _run_module_code
File "<frozen runpy>", line 88, in _run_code
File "flamingo/test-site/env/bin/_flamingo-server", line 63, in <module>
loop = asyncio.get_event_loop()
File "/usr/lib/python3.14/asyncio/events.py", line 715, in get_event_loop
raise RuntimeError('There is no current event loop in thread %r.'
% threading.current_thread().name)
RuntimeError: There is no current event loop in thread 'MainThread'.
Create the event loop instead.
Signed-off-by: Jonas Rebmann <jre@pengutronix.de>
Contributor
Author
|
CI failure seems to not be my fault we have |
Member
Yes. Fixing that is part of a larger changeset I am currently preparing. Sorry for that noise! |
SmithChart
approved these changes
Feb 26, 2026
Member
SmithChart
left a comment
There was a problem hiding this comment.
Thanks for the fix. I've given this a test on Python 3.11 (Debian oldstable) and python 3.13 (Debian stable) and it works there, too.
So: Looks good to me.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Starting with python 3.14, asyncio.get_event_loop() "Raises a RuntimeError if there is no current event loop." which we hit when trying to run the server with 3.14.3:
Create the event loop instead.