При подключенных одновременно модулях "requests" и "grequests" при выполнении не асинхронного запроса (requests) падает исключение:
Traceback (most recent call last):
File "C:/Users/alxhe/PycharmProjects/YB_Pump/YB_DataGetter.py", line 54, in <module>
act = act_tickers()
File "C:/Users/alxhe/PycharmProjects/YB_Pump/YB_DataGetter.py", line 16, in act_tickers
obj = requests.get(url)
File "C:\Users\alxhe\PycharmProjects\YB_Pump\venv\lib\site-packages\requests\api.py", line 72, in get
return request('get', url, params=params, **kwargs)
File "C:\Users\alxhe\PycharmProjects\YB_Pump\venv\lib\site-packages\requests\api.py", line 58, in request
return session.request(method=method, url=url, **kwargs)
File "C:\Users\alxhe\PycharmProjects\YB_Pump\venv\lib\site-packages\requests\sessions.py", line 508, in request
resp = self.send(prep, **send_kwargs)
File "C:\Users\alxhe\PycharmProjects\YB_Pump\venv\lib\site-packages\requests\sessions.py", line 618, in send
r = adapter.send(request, **kwargs)
File "C:\Users\alxhe\PycharmProjects\YB_Pump\venv\lib\site-packages\requests\adapters.py", line 440, in send
timeout=timeout
File "C:\Users\alxhe\PycharmProjects\YB_Pump\venv\lib\site-packages\urllib3\connectionpool.py", line 601, in urlopen
chunked=chunked)
File "C:\Users\alxhe\PycharmProjects\YB_Pump\venv\lib\site-packages\urllib3\connectionpool.py", line 346, in _make_request
self._validate_conn(conn)
File "C:\Users\alxhe\PycharmProjects\YB_Pump\venv\lib\site-packages\urllib3\connectionpool.py", line 850, in _validate_conn
conn.connect()
File "C:\Users\alxhe\PycharmProjects\YB_Pump\venv\lib\site-packages\urllib3\connection.py", line 314, in connect
cert_reqs=resolve_cert_reqs(self.cert_reqs),
File "C:\Users\alxhe\PycharmProjects\YB_Pump\venv\lib\site-packages\urllib3\util\ssl_.py", line 269, in create_urllib3_context
context.options |= options
File "C:\Users\alxhe\AppData\Local\Programs\Python\Python36\Lib\ssl.py", line 465, in options
super(SSLContext, SSLContext).options.__set__(self, value)
File "C:\Users\alxhe\AppData\Local\Programs\Python\Python36\Lib\ssl.py", line 465, in options
super(SSLContext, SSLContext).options.__set__(self, value)
File "C:\Users\alxhe\AppData\Local\Programs\Python\Python36\Lib\ssl.py", line 465, in options
super(SSLContext, SSLContext).options.__set__(self, value)
[Previous line repeated 323 more times]
RecursionError: maximum recursion depth exceeded while calling a Python object
При отключении grequests обычные запросы проходят на ура. Как победить?