Closed sandrotosi closed 2 years ago
In [27]: api = overpass.API(timeout=3) In [28]: response = api.Get(s) --------------------------------------------------------------------------- TimeoutError Traceback (most recent call last) <ipython-input-28-cee6cde6e022> in <module>() ----> 1 response = api.Get(s) /usr/lib/python3/dist-packages/overpass/api.py in Get(self, query, responseformat, verbosity) 43 44 # Get the response from Overpass ---> 45 raw_response = self._GetFromOverpass(full_query) 46 47 if responseformat == "xml": /usr/lib/python3/dist-packages/overpass/api.py in _GetFromOverpass(self, query) 100 101 except requests.exceptions.Timeout: --> 102 raise TimeoutError(self._timeout) 103 104 self._status = r.status_code TimeoutError: 25
that's because it uses self._timeout (always set to 25) but the API class defines the timeout as
self._timeout
self.timeout = kwargs.get("timeout", self._timeout)
and it's the correct value used to determine if it has timed out or not, so i think that's the value to be used in the exception as well
I think you are right, care to supply a PR with the fix?
Closing this for lack of activity. Feel free to re-open if this is still reproducible for you!
that's because it uses
self._timeout
(always set to 25) but the API class defines the timeout asself.timeout = kwargs.get("timeout", self._timeout)
and it's the correct value used to determine if it has timed out or not, so i think that's the value to be used in the exception as well