eclipse-paho / eclipse-paho/paho.mqtt.python

OSError have no include TimeoutError?

Open
#694 1 comment 0 reactions 0 assignees View on GitHub
Status: Available Status: Completed
Dominant language
Python
Stars
2.4k
Forks
742
Avg merge
12d 48m
Merged PRs (30d)
1

Description

I found this error⬇️
```bash
Exception in thread Thread-1 (_thread_main):
Traceback (most recent call last):
File "/opt/homebrew/Cellar/python@3.10/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
self.run()
File "/opt/homebrew/Cellar/python@3.10/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/threading.py", line 953, in run
self._target(*self._args, **self._kwargs)
File "/opt/homebrew/lib/python3.10/site-packages/paho/mqtt/client.py", line 3591, in _thread_main
self.loop_forever(retry_first_connection=True)
File "/opt/homebrew/lib/python3.10/site-packages/paho/mqtt/client.py", line 1756, in loop_forever
rc = self._loop(timeout)
File "/opt/homebrew/lib/python3.10/site-packages/paho/mqtt/client.py", line 1164, in _loop
rc = self.loop_read()
File "/opt/homebrew/lib/python3.10/site-packages/paho/mqtt/client.py", line 1556, in loop_read
rc = self._packet_read()
File "/opt/homebrew/lib/python3.10/site-packages/paho/mqtt/client.py", line 2370, in _packet_read
command = self._sock_recv(1)
File "/opt/homebrew/lib/python3.10/site-packages/paho/mqtt/client.py", line 640, in _sock_recv
return self._sock.recv(bufsize)
TimeoutError: [Errno 60] Operation timed out
```
and check the code:
image
```python
class ConnectionError(OSError): ...
```
**Looks fine, But it is none.
So I add this code:**
image
**It works.**
image

This is not the same as described in the previous issue #291 and #288 , why?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.