You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When attempting to call AsyncServer.enter_room() with await, a TypeError exception is thrown:
TypeError: object NoneType can't be used in 'await' expression
To Reproduce
Steps to reproduce the behavior:
Implement a basic AsyncServer class
On connect, attempt to enter SID into a room with await sio.enter_room(sid, 'testroom')
TypeError will be thrown
Calling the function without an await statement enters the client into the room as expected.
Expected behavior
The docs, along with code, label this function as a coroutine, when in fact it does not return any awaitable, making it functionally not a coroutine.
Additional context
The enter_room() method calls the AsyncServer's manager instance:
The enter_room and leave_room methods were not awaitable, and they should have been. I noticed this recently and have fixed it. These fixes have not been released yet.
My guess is that you are reading the "latest" version of the docs, which maps to the main branch. The "stable" docs should show these methods as regular functions. This is obviously going to be a breaking change.
Describe the bug
When attempting to call
AsyncServer.enter_room()
with await, a TypeError exception is thrown:TypeError: object NoneType can't be used in 'await' expression
To Reproduce
Steps to reproduce the behavior:
connect
, attempt to enter SID into a room withawait sio.enter_room(sid, 'testroom')
Calling the function without an await statement enters the client into the room as expected.
Expected behavior
The docs, along with code, label this function as a coroutine, when in fact it does not return any awaitable, making it functionally not a coroutine.
Additional context
The
enter_room()
method calls the AsyncServer's manager instance:python-socketio/src/socketio/async_manager.py
Line 72 in d40b3a3
Which calls the synchronous inherited function,
basic_enter_room()
. As such,None
is returned instead of an awaitable.The text was updated successfully, but these errors were encountered: