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
Using WebSocketResponse.can_prepare() method in aiohttp 2.0.0 raises AttributeError, regardless of whether to use uvloop or the vanilla asyncio loop.
If I skip a pre-cautious call to can_prepare(), everything works fine.
Expected behaviour
It should continue without AttributeError.
Actual behaviour
With uvloop 0.8:
File "/Users/joongi/Projects/Lablup/sorna-manager/sorna/gateway/kernel.py", line 502, in stream_pty
if not ws.can_prepare(request):
File "/Users/joongi/Projects/Lablup/sorna-manager/venv/lib/python3.6/site-packages/aiohttp/web_ws.py", line 1
40, in can_prepare
self._protocols)
File "/Users/joongi/Projects/Lablup/sorna-manager/venv/lib/python3.6/site-packages/aiohttp/http_websocket.py"
, line 570, in do_handshake
WebSocketWriter(stream, limit=write_buffer_size),
File "/Users/joongi/Projects/Lablup/sorna-manager/venv/lib/python3.6/site-packages/aiohttp/http_websocket.py"
, line 416, in __init__
self.writer = stream.transport
AttributeError: 'uvloop.loop.TCPTransport' object has no attribute 'transport'
With vanilla asyncio:
File "/Users/joongi/Projects/Lablup/sorna-manager/sorna/gateway/kernel.py", line 502, in stream_pty
if not ws.can_prepare(request):
File "/Users/joongi/Projects/Lablup/sorna-manager/venv/lib/python3.6/site-packages/aiohttp/web_ws.py", line 1
40, in can_prepare
self._protocols)
File "/Users/joongi/Projects/Lablup/sorna-manager/venv/lib/python3.6/site-packages/aiohttp/http_websocket.py"
, line 570, in do_handshake
WebSocketWriter(stream, limit=write_buffer_size),
File "/Users/joongi/Projects/Lablup/sorna-manager/venv/lib/python3.6/site-packages/aiohttp/http_websocket.py"
, line 416, in __init__
self.writer = stream.transport
AttributeError: '_SelectorSocketTransport' object has no attribute 'transport'
Steps to reproduce
Just make a simple WebSocket server and explicitly call can_prepare() like below:
asyncdefmy_ws_handler(request):
ws=web.WebSocketResponse()
ifnotws.can_prepare(request): # commenting out this if-clause makes it workingraiseweb.HTTPUpgradeRequiredawaitws.prepare(request)
...
Your environment
Python 3.6.0, aiohttp 2.0.0, uvloop 0.8.0 on macOS Sierra 10.2.1.
The text was updated successfully, but these errors were encountered:
Long story short
Using
WebSocketResponse.can_prepare()
method in aiohttp 2.0.0 raises AttributeError, regardless of whether to use uvloop or the vanilla asyncio loop.If I skip a pre-cautious call to
can_prepare()
, everything works fine.Expected behaviour
It should continue without AttributeError.
Actual behaviour
With uvloop 0.8:
With vanilla asyncio:
Steps to reproduce
Just make a simple WebSocket server and explicitly call
can_prepare()
like below:Your environment
Python 3.6.0, aiohttp 2.0.0, uvloop 0.8.0 on macOS Sierra 10.2.1.
The text was updated successfully, but these errors were encountered: