Skip to content

[BUG] autobahn.asyncio.component.run does not work with Python 3.14 #1952

Description

@lukas-komischke-ameos

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

  1. 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

  • I have searched existing issues to avoid duplicates
  • I have provided a minimal reproducible example
  • I have included version information
  • I have included error messages/logs

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions