It looks like you're new here. If you want to get involved, click one of these buttons!
Traceback (most recent call last):
File "/Users/Kousik/anaconda/lib/python3.5/site-packages/urllib3/connectionpool.py", line 387, in _make_request
six.raise_from(e, None)
File "<string>", line 2, in raise_from
File "/Users/Kousik/anaconda/lib/python3.5/site-packages/urllib3/connectionpool.py", line 383, in _make_request
httplib_response = conn.getresponse()
File "/Users/Kousik/anaconda/lib/python3.5/http/client.py", line 1197, in getresponse
response.begin()
File "/Users/Kousik/anaconda/lib/python3.5/http/client.py", line 297, in begin
version, status, reason = self._read_status()
File "/Users/Kousik/anaconda/lib/python3.5/http/client.py", line 258, in _read_status
line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
File "/Users/Kousik/anaconda/lib/python3.5/socket.py", line 575, in readinto
return self._sock.recv_into(b)
File "/Users/Kousik/anaconda/lib/python3.5/site-packages/urllib3/contrib/pyopenssl.py", line 296, in recv_into
return self.recv_into(*args, **kwargs)
File "/Users/Kousik/anaconda/lib/python3.5/site-packages/urllib3/contrib/pyopenssl.py", line 296, in recv_into
return self.recv_into(*args, **kwargs)
File "/Users/Kousik/anaconda/lib/python3.5/site-packages/urllib3/contrib/pyopenssl.py", line 296, in recv_into
return self.recv_into(*args, **kwargs)
File "/Users/Kousik/anaconda/lib/python3.5/site-packages/urllib3/contrib/pyopenssl.py", line 294, in recv_into
raise timeout('The read operation timed out')
socket.timeout: The read operation timed out
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/Kousik/anaconda/lib/python3.5/site-packages/requests/adapters.py", line 440, in send
timeout=timeout
File "/Users/Kousik/anaconda/lib/python3.5/site-packages/urllib3/connectionpool.py", line 639, in urlopen
_stacktrace=sys.exc_info()[2])
File "/Users/Kousik/anaconda/lib/python3.5/site-packages/urllib3/util/retry.py", line 357, in increment
raise six.reraise(type(error), error, _stacktrace)
File "/Users/Kousik/anaconda/lib/python3.5/site-packages/urllib3/packages/six.py", line 686, in reraise
raise value
File "/Users/Kousik/anaconda/lib/python3.5/site-packages/urllib3/connectionpool.py", line 601, in urlopen
chunked=chunked)
File "/Users/Kousik/anaconda/lib/python3.5/site-packages/urllib3/connectionpool.py", line 389, in _make_request
self._raise_timeout(err=e, url=url, timeout_value=read_timeout)
File "/Users/Kousik/anaconda/lib/python3.5/site-packages/urllib3/connectionpool.py", line 309, in _raise_timeout
raise ReadTimeoutError(self, url, "Read timed out. (read timeout=%s)" % timeout_value)
urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='api.kite.trade', port=443): Read timed out. (read timeout=7)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/Kousik/anaconda/lib/python3.5/site-packages/kiteconnect/__init__.py", line 648, in _request
proxies=self.proxies)
File "/Users/Kousik/anaconda/lib/python3.5/site-packages/requests/api.py", line 58, in request
return session.request(method=method, url=url, **kwargs)
File "/Users/Kousik/anaconda/lib/python3.5/site-packages/requests/sessions.py", line 508, in request
resp = self.send(prep, **send_kwargs)
File "/Users/Kousik/anaconda/lib/python3.5/site-packages/requests/sessions.py", line 618, in send
r = adapter.send(request, **kwargs)
File "/Users/Kousik/anaconda/lib/python3.5/site-packages/requests/adapters.py", line 521, in send
raise ReadTimeout(e, request=request)
requests.exceptions.ReadTimeout: HTTPSConnectionPool(host='api.kite.trade', port=443): Read timed out. (read timeout=7)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "data_collection.py", line 91, in <module>
main()
File "data_collection.py", line 89, in main
break_and_get_data(key,folder_location,isin_token_dict[key],start_date,"day")
File "data_collection.py", line 75, in break_and_get_data
his = get_historical_data(instrument_token,str(last_date),str(today_date),interval)
File "data_collection.py", line 44, in get_historical_data
return(kite.historical(instrument_token,from_date,to_date,interval))
File "/Users/Kousik/anaconda/lib/python3.5/site-packages/kiteconnect/__init__.py", line 538, in historical
"continuous": 1 if continuous else 0})
File "/Users/Kousik/anaconda/lib/python3.5/site-packages/kiteconnect/__init__.py", line 593, in _get
return self._request(route, "GET", params)
File "/Users/Kousik/anaconda/lib/python3.5/site-packages/kiteconnect/__init__.py", line 652, in _request
raise ex.ClientNetworkException("Gateway timed out", code=504)
kiteconnect.exceptions.ClientNetworkException: Gateway timed out
I am able to access for around 20 different instruments then it suddenly throws me this error. The number 20 is just random(i.e sometimes it is 20,14,33,...)