After upgrading to Python 3.14, running any aiocli command fails with the following error:
Traceback (mostrecentcalllast):
...
File"aiocli/commander.py", line143, inwrapperloop_=looporget_event_loop()
~~~~~~~~~~~~~~^^File"/usr/local/lib/python3.14/asyncio/events.py", line715, inget_event_loopraiseRuntimeError('There is no current event loop in thread %r.'%threading.current_thread().name)
RuntimeError: Thereisnocurrenteventloopinthread'MainThread'.This happens because Python 3.14 removed implicit event loop creation (see PEP 719), so asyncio.get_event_loop() now raises RuntimeError when called outside a running loop.
Expected Behavior
aiocli should automatically create an event loop if none exists, maintaining backward compatibility with Python ≤3.13.
Actual Behavior
RuntimeError: There is no current event loop in thread 'MainThread'.
Suggested Fix
Wrap the call in aiocli/commander.py with safe event loop initialization:
importasynciodefget_safe_event_loop():
try:
returnasyncio.get_running_loop()
exceptRuntimeError:
loop=asyncio.new_event_loop()
asyncio.set_event_loop(loop)
returnloop
Then replace:
loop_=looporget_event_loop()
with:
loop_=looporget_safe_event_loop()
Additional Notes
Also seeing a warning from pyparsing under Python 3.14:
SyntaxWarning: 'return'ina'finally'block
(probably unrelated, just noticed in the same run).
After upgrading to Python 3.14, running any aiocli command fails with the following error:
This happens because Python 3.14 removed implicit event loop creation (see PEP 719), so asyncio.get_event_loop() now raises RuntimeError when called outside a running loop.
Expected Behavior
aiocli should automatically create an event loop if none exists, maintaining backward compatibility with Python ≤3.13.
Actual Behavior
RuntimeError: There is no current event loop in thread 'MainThread'.
Suggested Fix
Wrap the call in aiocli/commander.py with safe event loop initialization:
Then replace:
with:
Additional Notes
Also seeing a warning from pyparsing under Python 3.14:
(probably unrelated, just noticed in the same run).