AttributeError: 'WebSocket' object has no attribute 'socket' #24
Comments
@no13bus Can you show the code that throws that error? |
I just ran into this as well. This code is from: @sockets.route('/receive')
def outbox(ws):
"""Sends outgoing chat messages, via `ChatBackend`."""
chats.register(ws)
while ws.socket is not None:
# Context switch while `ChatBackend.start` is running in the background.
gevent.sleep() |
The issue does not occur if you downgrade gevent-websocket to version 0.3.6 as discussed here: https://bitbucket.org/Jeffrey/gevent-websocket/issue/50/errors-with-version-092-and-flask-sockets However, the last solution provided in that discussion to work with the recent version of gevent-websocket did not work for me. Hope this helps someone. |
It looks like the websocket api changed. An websocket object has no longer a @jcipriano What happens if you use the solution with EDIT: Changed |
Thanks @syntonym, that worked for me. |
@syntonym |
@ondrae You are of course correct. Thanks! BTW: This issue can probably be closed? |
|
my flask version is 0.10.
When I type
gunicorn -k flask_sockets.worker chat:app
, there is an error:AttributeError: 'WebSocket' object has no attribute 'socket'
why?
The text was updated successfully, but these errors were encountered: