Bug Description
Summary:
autobahn.asyncio.component.run raises a RuntimeError if used without previously starting an asyncio loop.
Expected Behavior:
Like with Python <= 3.13, autobahn-python should create an asyncio loop if none exists.
Actual Behavior:
Because of changes in the default behavior of asyncio.get_event_loop, autobahn.asyncio.component.run raises a RuntimeError if used without previously starting an asyncio loop.
Reproduction Steps
- Try running a
Component using run (see the minimal example below)
Minimal Reproducible Example:
from autobahn.asyncio.component import Component, run
if __name__ == '__main__':
component = Component(
transports=[
{
'type': 'websocket',
'url': 'ws://127.0.0.1:8801/ws',
'options': {
'open_handshake_timeout': 100,
}
},
],
authentication={'anonymous': {}},
realm='example_realm',
)
run([component], start_loop=True, log_level='debug')
Environment
- Package: autobahn-python
- Version: 26.7.1
- Python Version: CPython 3.14.7
- Operating System: EndeavourOS
- Framework: asyncio
Additional Context
Error Messages:
Traceback (most recent call last):
File "/home/.../scratch_167.py", line 19, in <module>
run([component], start_loop=True, log_level='debug')
~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/.../lib/python3.14/site-packages/autobahn/asyncio/component.py", line 359, in run
loop = asyncio.get_event_loop()
File "/usr/lib/python3.14/asyncio/events.py", line 718, 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'.
Relevant Logs:
None
Screenshots:
None
Related Issues:
None
Checklist
Bug Description
Summary:
autobahn.asyncio.component.runraises aRuntimeErrorif used without previously starting an asyncio loop.Expected Behavior:
Like with Python <= 3.13, autobahn-python should create an asyncio loop if none exists.
Actual Behavior:
Because of changes in the default behavior of asyncio.get_event_loop,
autobahn.asyncio.component.runraises aRuntimeErrorif used without previously starting an asyncio loop.Reproduction Steps
Componentusingrun(see the minimal example below)Minimal Reproducible Example:
Environment
Additional Context
Error Messages:
Relevant Logs:
None
Screenshots:
None
Related Issues:
None
Checklist