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
[Connecting(url='ws://www.google.com'), Connected(url='ws://www.google.com'), Rejected(<response HTTP/1.1 400 Bad Request>, 'Websocket upgrade failed (code=400)'), Disconnected('error; file descriptor cannot be a negative integer (-1)', graceful=False)]
error in websocket loop
Traceback (most recent call last):
File "C:\Projects\venv\websocket_client_playground\lib\site-packages\lomond\session.py", line 384, in run
readable = selector.wait_readable(poll)
File "C:\Projects\venv\websocket_client_playground\lib\site-packages\lomond\selectors.py", line 32, in wait_readable
select.select([self._socket.fileno()], [], [], timeout)
ValueError: file descriptor cannot be a negative integer (-1)
Environment:
Python 3.5.3
lomond 0.2.1
Windows 10 Pro 1709 16299.309
When a HandshakeError is encountered in WebSocket.feed(), leading to a Rejected event, the socket is ultimately closed. The issue is with the call to select() in SelectSelector.wait_readable() which happens after this, as self._socket.fileno() will return -1.
A trivial solution is to wrap the code in wait_readable() in a blanket try/except and return True in the failure case. This will allow normal processing to proceed in WebsocketSession.run() and the session will close out gracefully.
The text was updated successfully, but these errors were encountered:
The following trivial script results in a
log.exception()
message in Windows, which doesn't seem like the expected behavior.Output:
Environment:
When a
HandshakeError
is encountered inWebSocket.feed()
, leading to aRejected
event, the socket is ultimately closed. The issue is with the call toselect()
inSelectSelector.wait_readable()
which happens after this, asself._socket.fileno()
will return -1.A trivial solution is to wrap the code in
wait_readable()
in a blanket try/except and returnTrue
in the failure case. This will allow normal processing to proceed inWebsocketSession.run()
and the session will close out gracefully.The text was updated successfully, but these errors were encountered: