Repository navigation
fix: create event-loop on Python 3.14 where get_event_loop raises - #314
Merged
Merged
Conversation
Python 3.14 removed implicit event-loop creation in the main thread; asyncio.get_event_loop() now raises RuntimeError when no loop is set. Wrap loop lookup in _get_or_create_event_loop() so synchronous use of the client (Asynchronous metaclass, is_loop_running) keeps working: fall back to creating and setting a new loop, matching the behaviour of Python <= 3.12.
hemanthnakkina
added a commit
to hemanthnakkina/snap-openstack
that referenced
this pull request
Nov 30, 2026
Lock python-libmaas to the revision from canonical/python-libmaas#314 while the fix is pending. This restores synchronous calls made before an asyncio event loop has been set.
r00ta
approved these changes
Nov 30, 2026
Contributor
Author
|
@r00ta I see CI builds not started for more than 18 hours. Are these runners from github? Is it makes sense to cancel the workflow and rerun them? |
hemanthnakkina
added a commit
to canonical/snap-openstack
that referenced
this pull request
Dec 1, 2026
Pin the branch carrying the async event-loop fix from canonical/python-libmaas#314 and update the lockfile. Signed-off-by: Hemanth Nakkina <hemanth.nakkina@canonical.com>
gboutry
pushed a commit
to canonical/snap-openstack
that referenced
this pull request
Dec 2, 2026
python-libmaas was previously pinned to a personal fork commit. PR #314 [1] has been merged upstream, so point to canonical/python-libmaas at the merge commit e689368e instead. [1] canonical/python-libmaas#314
victorsantos-baires
added a commit
to victorsantos-baires/snap-openstack
that referenced
this pull request
Dec 3, 2026
python-libmaas 0.6.8 from PyPI calls asyncio.get_event_loop() with no running loop, which raises RuntimeError on Python 3.14. On the core26 snap, `sunbeam deployment add maas` fails with "There is no current event loop in thread 'MainThread'". Pin canonical/python-libmaas at the merge commit of the fix [1], as done on stable/2026.1 in canonical#1065, and update the lockfile. [1] canonical/python-libmaas#314 Closes-Bug: #2180159 Signed-off-by: victor.santos <victor.santos@canonical.com>
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.
Python 3.14 removed implicit event-loop creation in the main thread; asyncio.get_event_loop() now raises RuntimeError when no loop is set. Wrap loop lookup in _get_or_create_event_loop() so synchronous use of the client (Asynchronous metaclass, is_loop_running) keeps working: fall back to creating and setting a new loop, matching the behaviour of Python <= 3.12.