websocket-client: AttributeError: 'NoneType' object has no attribute 'connected'
My on_open callback sends some data to the server when the connection is established. Usually, it works, but some times i receive the following error.
The following exception is captured in the on_error callback.
Traceback (most recent call last):
File "[...]/python3.5/site-packages/websocket/_app.py", line 278, in run_forever
dispatcher.read(self.sock.sock, read)
File "[...]/python3.5/site-packages/websocket/_app.py", line 48, in read
while self.app.sock.connected:
AttributeError: 'NoneType' object has no attribute 'connected'
I’m afraid I cannot provide more useful data to reproduce the problem as it appears to be raised randomly.
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 19
Links to this issue
Commits related to this issue
- Fix for errors that occur when closing websocket https://github.com/websocket-client/websocket-client/issues/449 — committed to olie304/websocket-client by olie304 5 years ago
- use latest websocket-client version reason: to fix the following issue https://github.com/websocket-client/websocket-client/issues/449 https://github.com/websocket-client/websocket-client/pull/586 — committed to wazo-platform/wazo-acceptance by fblackburn1 5 years ago
- use latest websocket-client version reason: to fix the following issue https://github.com/websocket-client/websocket-client/issues/449 https://github.com/websocket-client/websocket-client/pull/586 — committed to wazo-platform/wazo-acceptance by fblackburn1 5 years ago
- Fix clean exit from cli See https://github.com/websocket-client/websocket-client/issues/449 Closes: #594 — committed to bitphage/DEXBot by bitphage 4 years ago
I have the same problem when I close socket.
It triggers on_error: ‘NoneType’ object has no attribute ‘connected’