crossbario / autobahn-python

WebSocket and WAMP in Python for Twisted and asyncio
https://crossbar.io/autobahn
MIT License
2.47k stars 763 forks source link

txaio.use_asyncio() required #1563

Closed terokinnunen closed 2 years ago

terokinnunen commented 2 years ago

Since 22.4.1 asyncio user must call txaio.use_asyncio() before importing autobahn, or specify USE_ASYNCIO environment variable. With 22.3.2 this was not necessary.

Steps to reproduce

$ pip install autobahn[asyncio]
$ python examples/asyncio/wamp/pubsub/basic/frontend.py 
Traceback (most recent call last):
  File "/tmp/tst/examples/asyncio/wamp/pubsub/basic/frontend.py", line 29, in <module>
    from autobahn.asyncio.wamp import ApplicationSession, ApplicationRunner
  File "/tmp/tst/venv/lib64/python3.10/site-packages/autobahn/asyncio/__init__.py", line 32, in <module>
    from autobahn.asyncio.websocket import \
  File "/tmp/tst/venv/lib64/python3.10/site-packages/autobahn/asyncio/websocket.py", line 36, in <module>
    from autobahn.wamp import websocket
  File "/tmp/tst/venv/lib64/python3.10/site-packages/autobahn/wamp/websocket.py", line 32, in <module>
    from autobahn.websocket import protocol
  File "/tmp/tst/venv/lib64/python3.10/site-packages/autobahn/websocket/protocol.py", line 2533, in <module>
    class WebSocketServerProtocol(WebSocketProtocol):
  File "/tmp/tst/venv/lib64/python3.10/site-packages/autobahn/websocket/protocol.py", line 2538, in WebSocketServerProtocol
    log = txaio.make_logger()
  File "/tmp/tst/venv/lib64/python3.10/site-packages/txaio/_unframework.py", line 41, in _throw_usage_error
    raise RuntimeError(
RuntimeError: To use txaio, you must first select a framework with .use_twisted() or .use_asyncio()
$
oberstet commented 2 years ago

fixed via https://github.com/crossbario/autobahn-python/pull/1564 tested https://gist.github.com/oberstet/1e9198d57c16be357bb765d40d3e915e

terokinnunen commented 2 years ago

Thanks! When is next release planned? Just considering whether to do workarounds or not...

oberstet commented 2 years ago

There will be a 22.5 release till end of this month .. so "very soon";)