The only case discovery uses httplib2 is that by default http = httplib2.Http(). I dont know the alternative in requests library, because don
t understand what url they exactly use.
I`ve noticed that the error log has changed: the error came not while discovery service is building, but when when tries to perform actions with the spreadsheet:
Traceback (most recent call last):
2017-07-11 08:15:58,543: File "/usr/local/lib/python3.6/dist-packages/flask/app.py", line 1982, in wsgi_app
2017-07-11 08:15:58,543: response = self.full_dispatch_request()
2017-07-11 08:15:58,544: File "/usr/local/lib/python3.6/dist-packages/flask/app.py", line 1614, in full_dispatch_request
2017-07-11 08:15:58,544: rv = self.handle_user_exception(e)
2017-07-11 08:15:58,544: File "/usr/local/lib/python3.6/dist-packages/flask/app.py", line 1517, in handle_user_exception
2017-07-11 08:15:58,544: reraise(exc_type, exc_value, tb)
2017-07-11 08:15:58,544: File "/usr/local/lib/python3.6/dist-packages/flask/_compat.py", line 33, in reraise
2017-07-11 08:15:58,544: raise value
2017-07-11 08:15:58,545: File "/usr/local/lib/python3.6/dist-packages/flask/app.py", line 1612, in full_dispatch_request
2017-07-11 08:15:58,545: rv = self.dispatch_request()
2017-07-11 08:15:58,545: File "/usr/local/lib/python3.6/dist-packages/flask/app.py", line 1598, in dispatch_request
2017-07-11 08:15:58,545: return self.view_functions[rule.endpoint](**req.view_args)
2017-07-11 08:15:58,545: File "/home/InnoLinksBot/mysite/flask_app.py", line 22, in update_data
2017-07-11 08:15:58,545: fill_database(app.config['DATABASE'])
2017-07-11 08:15:58,545: File "/home/InnoLinksBot/mysite/parser.py", line 81, in fill_database
2017-07-11 08:15:58,546: result = service.spreadsheets().values().get(spreadsheetId=spreadsheetId, range=rangeName).execute()
2017-07-11 08:15:58,546: File "/home/InnoLinksBot/.local/lib/python3.6/site-packages/oauth2client/_helpers.py", line 133, in positional_wrapper
2017-07-11 08:15:58,546: return wrapped(*args, **kwargs)
2017-07-11 08:15:58,546: File "/usr/local/lib/python3.6/dist-packages/googleapiclient/http.py", line 835, in execute
2017-07-11 08:15:58,546: method=str(self.method), body=self.body, headers=self.headers)
2017-07-11 08:15:58,546: File "/usr/local/lib/python3.6/dist-packages/googleapiclient/http.py", line 162, in _retry_request
2017-07-11 08:15:58,546: resp, content = http.request(uri, method, *args, **kwargs)
2017-07-11 08:15:58,546: File "/home/InnoLinksBot/.local/lib/python3.6/site-packages/oauth2client/transport.py", line 186, in new_request
2017-07-11 08:15:58,546: credentials._refresh(orig_request_method)
2017-07-11 08:15:58,547: File "/home/InnoLinksBot/.local/lib/python3.6/site-packages/oauth2client/client.py", line 761, in _refresh
2017-07-11 08:15:58,547: self._do_refresh_request(http)
2017-07-11 08:15:58,547: File "/home/InnoLinksBot/.local/lib/python3.6/site-packages/oauth2client/client.py", line 780, in _do_refresh_request
2017-07-11 08:15:58,547: body=body, headers=headers)
2017-07-11 08:15:58,547: File "/home/InnoLinksBot/.local/lib/python3.6/site-packages/oauth2client/transport.py", line 282, in request
2017-07-11 08:15:58,547: connection_type=connection_type)
2017-07-11 08:15:58,547: File "/usr/local/lib/python3.6/dist-packages/httplib2/__init__.py", line 1322, in request
2017-07-11 08:15:58,547: (response, content) = self._request(conn, authority, uri, request_uri, method, body, headers, redirections, cachekey)
2017-07-11 08:15:58,548: File "/usr/local/lib/python3.6/dist-packages/httplib2/__init__.py", line 1072, in _request
2017-07-11 08:15:58,548: (response, content) = self._conn_request(conn, request_uri, method, body, headers)
2017-07-11 08:15:58,548: File "/usr/local/lib/python3.6/dist-packages/httplib2/__init__.py", line 995, in _conn_request
2017-07-11 08:15:58,548: conn.connect()
2017-07-11 08:15:58,548: File "/usr/lib/python3.6/http/client.py", line 1392, in connect
2017-07-11 08:15:58,548: super().connect()
2017-07-11 08:15:58,548: File "/usr/lib/python3.6/http/client.py", line 936, in connect
2017-07-11 08:15:58,548: (self.host,self.port), self.timeout, self.source_address)
2017-07-11 08:15:58,549: File "/usr/lib/python3.6/socket.py", line 722, in create_connection
2017-07-11 08:15:58,549: raise err
2017-07-11 08:15:58,549: File "/usr/lib/python3.6/socket.py", line 713, in create_connection
2017-07-11 08:15:58,549: sock.connect(sa)
2017-07-11 08:15:58,549: OSError: [Errno 101] Network is unreachable