kite.ltp() causes this error: Max retries exceeded with url

nikhilchawla
#Error due to( which I guess) :
rev_ltp = kite.ltp("NFO:"+rev_symbol)["NFO:"+rev_symbol]["last_price"]
calling kite.ltp() many times in short span of time.
Please Let me know if that's the case then what are its limitations ?
Please help
Thanks


#Below is the complete error:

Exception in thread Thread-2092:300.45
Traceback (most recent call last):
File "C:\Users\ACER INDIA\Anaconda3\lib\site-packages\urllib3\contrib\pyopenssl.py", line 453, in wrap_socket
cnx.do_handshake()
File "C:\Users\ACER INDIA\Anaconda3\lib\site-packages\OpenSSL\SSL.py", line 1915, in do_handshake
self._raise_ssl_error(self._ssl, result)
File "C:\Users\ACER INDIA\Anaconda3\lib\site-packages\OpenSSL\SSL.py", line 1639, in _raise_ssl_error
raise SysCallError(errno, errorcode.get(errno))
OpenSSL.SSL.SysCallError: (10054, 'WSAECONNRESET')

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\ACER INDIA\Anaconda3\lib\site-packages\urllib3\connectionpool.py", line 600, in urlopen
chunked=chunked)
File "C:\Users\ACER INDIA\Anaconda3\lib\site-packages\urllib3\connectionpool.py", line 343, in _make_request
self._validate_conn(conn)
File "C:\Users\ACER INDIA\Anaconda3\lib\site-packages\urllib3\connectionpool.py", line 839, in _validate_conn
conn.connect()
File "C:\Users\ACER INDIA\Anaconda3\lib\site-packages\urllib3\connection.py", line 344, in connect
ssl_context=context)
File "C:\Users\ACER INDIA\Anaconda3\lib\site-packages\urllib3\util\ssl_.py", line 344, in ssl_wrap_socket
return context.wrap_socket(sock, server_hostname=server_hostname)
File "C:\Users\ACER INDIA\Anaconda3\lib\site-packages\urllib3\contrib\pyopenssl.py", line 459, in wrap_socket
raise ssl.SSLError('bad handshake: %r' % e)
ssl.SSLError: ("bad handshake: SysCallError(10054, 'WSAECONNRESET')",)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\ACER INDIA\Anaconda3\lib\site-packages\requests\adapters.py", line 449, in send
timeout=timeout
File "C:\Users\ACER INDIA\Anaconda3\lib\site-packages\urllib3\connectionpool.py", line 638, in urlopen
_stacktrace=sys.exc_info()[2])
File "C:\Users\ACER INDIA\Anaconda3\lib\site-packages\urllib3\util\retry.py", line 398, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='api.kite.trade', port=443): Max retries exceeded with url: /quote/ltp?i=NFO%3ABANKNIFTY2151233200CE (Caused by SSLError(SSLError("bad handshake: SysCallError(10054, 'WSAECONNRESET')")))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\ACER INDIA\Anaconda3\lib\threading.py", line 917, in _bootstrap_inner
self.run()
File "C:\Users\ACER INDIA\Anaconda3\lib\threading.py", line 865, in run
self._target(*self._args, **self._kwargs)
File "strategy1.4.py", line 335, in starting
main()
File "strategy1.4.py", line 183, in main
rev_ltp = kite.ltp("NFO:"+rev_symbol)["NFO:"+rev_symbol]["last_price"]
File "C:\Users\ACER INDIA\Anaconda3\lib\site-packages\kiteconnect\connect.py", line 595, in ltp
return self._get("market.quote.ltp", {"i": ins})
File "C:\Users\ACER INDIA\Anaconda3\lib\site-packages\kiteconnect\connect.py", line 817, in _get
return self._request(route, "GET", params)
File "C:\Users\ACER INDIA\Anaconda3\lib\site-packages\kiteconnect\connect.py", line 865, in _request
raise e
File "C:\Users\ACER INDIA\Anaconda3\lib\site-packages\kiteconnect\connect.py", line 862, in _request
proxies=self.proxies)
File "C:\Users\ACER INDIA\Anaconda3\lib\site-packages\requests\api.py", line 60, in request
return session.request(method=method, url=url, **kwargs)
File "C:\Users\ACER INDIA\Anaconda3\lib\site-packages\requests\sessions.py", line 533, in request
resp = self.send(prep, **send_kwargs)
File "C:\Users\ACER INDIA\Anaconda3\lib\site-packages\requests\sessions.py", line 646, in send
r = adapter.send(request, **kwargs)
File "C:\Users\ACER INDIA\Anaconda3\lib\site-packages\requests\adapters.py", line 514, in send
raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='api.kite.trade', port=443): Max retries exceeded with url: /quote/ltp?i=NFO%3ABANKNIFTY2151233200CE (Caused by SSLError(SSLError("bad handshake: SysCallError(10054, 'WSAECONNRESET')")))
This discussion has been closed.