title: Read operation timed out (Requests) in Python 3.9
body: <p>I'm trying to write a program that logs aircraft positions within the airport range. The database that provides me with information is often really slow. Everything works as hoped except it sometimes crashes with the explanation that &quot;The read operation timed out&quot;. I thought it would be the database that can't keep up with my requests so I added a sleep of 15 seconds in between requests. To my (little) understanding the 'Opensky API' uses the Python package 'Requests'. Is there any possibility the program retries reading after an error rather than stopping completely?</p>
  <p>Code and full error message below.</p>
  <p>Code:</p>
  <pre><code>import time
  from opensky_api import OpenSkyApi
  from time import sleep
  
  time = int(time.time())
  
  lats = []
  lons = []
  angl = []
  vel = []
  
  api = OpenSkyApi('USER', 'PASS')
  for x in range(time-600, time, 30):
      print(x)
      # bbox = (min latitude, max latitude, min longitude, max longitude)
      states = api.get_states(time_secs=x, bbox=(49.9028, 51.9028, 3.4862, 5.4862))
      if states:
          for s in states.states:
              if s.latitude and s.longitude:
                  print(&quot;(%r, %r)&quot; % (s.longitude, s.latitude))
                  lats.append(s.latitude)
                  lons.append(s.longitude)
      print('*' * 40)
      sleep(15)
  </code></pre>
  <p>Error:</p>
  <pre><code>Traceback (most recent call last):
    File &quot;C:\Users\debba\PycharmProjects\Testomgeving\venv\lib\site-packages\urllib3\connectionpool.py&quot;, line 445, in _make_request
      six.raise_from(e, None)
    File &quot;&lt;string&gt;&quot;, line 3, in raise_from
    File &quot;C:\Users\debba\PycharmProjects\Testomgeving\venv\lib\site-packages\urllib3\connectionpool.py&quot;, line 440, in _make_request
      httplib_response = conn.getresponse()
    File &quot;C:\Users\debba\AppData\Local\Programs\Python\Python39\lib\http\client.py&quot;, line 1371, in getresponse
      response.begin()
    File &quot;C:\Users\debba\AppData\Local\Programs\Python\Python39\lib\http\client.py&quot;, line 319, in begin
      version, status, reason = self._read_status()
    File &quot;C:\Users\debba\AppData\Local\Programs\Python\Python39\lib\http\client.py&quot;, line 280, in _read_status
      line = str(self.fp.readline(_MAXLINE + 1), &quot;iso-8859-1&quot;)
    File &quot;C:\Users\debba\AppData\Local\Programs\Python\Python39\lib\socket.py&quot;, line 704, in readinto
      return self._sock.recv_into(b)
    File &quot;C:\Users\debba\AppData\Local\Programs\Python\Python39\lib\ssl.py&quot;, line 1241, in recv_into
      return self.read(nbytes, buffer)
    File &quot;C:\Users\debba\AppData\Local\Programs\Python\Python39\lib\ssl.py&quot;, line 1099, in read
      return self._sslobj.read(len, buffer)
  socket.timeout: The read operation timed out
  
  During handling of the above exception, another exception occurred:
  
  Traceback (most recent call last):
    File &quot;C:\Users\debba\PycharmProjects\Testomgeving\venv\lib\site-packages\requests\adapters.py&quot;, line 439, in send
      resp = conn.urlopen(
    File &quot;C:\Users\debba\PycharmProjects\Testomgeving\venv\lib\site-packages\urllib3\connectionpool.py&quot;, line 755, in urlopen
      retries = retries.increment(
    File &quot;C:\Users\debba\PycharmProjects\Testomgeving\venv\lib\site-packages\urllib3\util\retry.py&quot;, line 532, in increment
      raise six.reraise(type(error), error, _stacktrace)
    File &quot;C:\Users\debba\PycharmProjects\Testomgeving\venv\lib\site-packages\urllib3\packages\six.py&quot;, line 770, in reraise
      raise value
    File &quot;C:\Users\debba\PycharmProjects\Testomgeving\venv\lib\site-packages\urllib3\connectionpool.py&quot;, line 699, in urlopen
      httplib_response = self._make_request(
    File &quot;C:\Users\debba\PycharmProjects\Testomgeving\venv\lib\site-packages\urllib3\connectionpool.py&quot;, line 447, in _make_request
      self._raise_timeout(err=e, url=url, timeout_value=read_timeout)
    File &quot;C:\Users\debba\PycharmProjects\Testomgeving\venv\lib\site-packages\urllib3\connectionpool.py&quot;, line 336, in _raise_timeout
      raise ReadTimeoutError(
  urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='opensky-network.org', port=443): Read timed out. (read timeout=15.0)
  
  During handling of the above exception, another exception occurred:
  
  Traceback (most recent call last):
    File &quot;C:\Users\debba\PycharmProjects\Testomgeving\main.py&quot;, line 16, in &lt;module&gt;
      states = api.get_states(time_secs=x)
    File &quot;c:\users\debba\pycharmprojects\testomgeving\venv\src\opensky-api\python\opensky_api.py&quot;, line 178, in get_states
      states_json = self._get_json(&quot;/states/all&quot;, self.get_states,
    File &quot;c:\users\debba\pycharmprojects\testomgeving\venv\src\opensky-api\python\opensky_api.py&quot;, line 115, in _get_json
      r = requests.get(&quot;{0:s}{1:s}&quot;.format(self._api_url, url_post),
    File &quot;C:\Users\debba\PycharmProjects\Testomgeving\venv\lib\site-packages\requests\api.py&quot;, line 75, in get
      return request('get', url, params=params, **kwargs)
    File &quot;C:\Users\debba\PycharmProjects\Testomgeving\venv\lib\site-packages\requests\api.py&quot;, line 61, in request
      return session.request(method=method, url=url, **kwargs)
    File &quot;C:\Users\debba\PycharmProjects\Testomgeving\venv\lib\site-packages\requests\sessions.py&quot;, line 542, in request
      resp = self.send(prep, **send_kwargs)
    File &quot;C:\Users\debba\PycharmProjects\Testomgeving\venv\lib\site-packages\requests\sessions.py&quot;, line 655, in send
      r = adapter.send(request, **kwargs)
    File &quot;C:\Users\debba\PycharmProjects\Testomgeving\venv\lib\site-packages\requests\adapters.py&quot;, line 529, in send
      raise ReadTimeout(e, request=request)
  requests.exceptions.ReadTimeout: HTTPSConnectionPool(host='opensky-network.org', port=443): Read timed out. (read timeout=15.0)
  </code></pre>