ReadTimeout: HTTPSConnectionPool(host=’api.binance.com’, port=443): Read timed out. (read timeout=None)

I am working on an algorithmic trading project using the Binance API. The API was working fine until the recent internet blackout in Bangladesh. However, even after the internet was restored, the Binance API still isn’t functioning in my project. I consistently receive a timeout error when making requests.

I have tried using 5-6 different Python libraries and 3 Node.js libraries to connect to the Binance server, but nothing has worked. Despite this, the API is working fine in the Google Chrome browser, and I can access it via the browser’s developer console.

Here is a code snippet from my project:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>url = "https://api.binance.com/api/v3/exchangeInfo"
response = requests.get(url)
print(response.status_code)
</code>
<code>url = "https://api.binance.com/api/v3/exchangeInfo" response = requests.get(url) print(response.status_code) </code>
url = "https://api.binance.com/api/v3/exchangeInfo"
response = requests.get(url)
print(response.status_code)

Here is the error:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>---------------------------------------------------------------------------
TimeoutError Traceback (most recent call last)
File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesurllib3connectionpool.py:466, in HTTPConnectionPool._make_request(self, conn, method, url, body, headers, retries, timeout, chunked, response_conn, preload_content, decode_content, enforce_content_length)
465 try:
--> 466 self._validate_conn(conn)
467 except (SocketTimeout, BaseSSLError) as e:
File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesurllib3connectionpool.py:1095, in HTTPSConnectionPool._validate_conn(self, conn)
1094 if conn.is_closed:
-> 1095 conn.connect()
1097 # TODO revise this, see https://github.com/urllib3/urllib3/issues/2791
File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesurllib3connection.py:652, in HTTPSConnection.connect(self)
650 server_hostname_rm_dot = server_hostname.rstrip(".")
--> 652 sock_and_verified = _ssl_wrap_socket_and_match_hostname(
653 sock=sock,
654 cert_reqs=self.cert_reqs,
655 ssl_version=self.ssl_version,
656 ssl_minimum_version=self.ssl_minimum_version,
657 ssl_maximum_version=self.ssl_maximum_version,
658 ca_certs=self.ca_certs,
659 ca_cert_dir=self.ca_cert_dir,
660 ca_cert_data=self.ca_cert_data,
661 cert_file=self.cert_file,
662 key_file=self.key_file,
663 key_password=self.key_password,
664 server_hostname=server_hostname_rm_dot,
665 ssl_context=self.ssl_context,
666 tls_in_tls=tls_in_tls,
667 assert_hostname=self.assert_hostname,
668 assert_fingerprint=self.assert_fingerprint,
669 )
670 self.sock = sock_and_verified.socket
File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesurllib3connection.py:805, in _ssl_wrap_socket_and_match_hostname(sock, cert_reqs, ssl_version, ssl_minimum_version, ssl_maximum_version, cert_file, key_file, key_password, ca_certs, ca_cert_dir, ca_cert_data, assert_hostname, assert_fingerprint, server_hostname, ssl_context, tls_in_tls)
803 server_hostname = normalized
--> 805 ssl_sock = ssl_wrap_socket(
806 sock=sock,
807 keyfile=key_file,
808 certfile=cert_file,
809 key_password=key_password,
810 ca_certs=ca_certs,
811 ca_cert_dir=ca_cert_dir,
812 ca_cert_data=ca_cert_data,
813 server_hostname=server_hostname,
814 ssl_context=context,
815 tls_in_tls=tls_in_tls,
816 )
818 try:
File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesurllib3utilssl_.py:465, in ssl_wrap_socket(sock, keyfile, certfile, cert_reqs, ca_certs, server_hostname, ssl_version, ciphers, ssl_context, ca_cert_dir, key_password, ca_cert_data, tls_in_tls)
463 pass
--> 465 ssl_sock = _ssl_wrap_socket_impl(sock, context, tls_in_tls, server_hostname)
466 return ssl_sock
File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesurllib3utilssl_.py:509, in _ssl_wrap_socket_impl(sock, ssl_context, tls_in_tls, server_hostname)
507 return SSLTransport(sock, ssl_context, server_hostname)
--> 509 return ssl_context.wrap_socket(sock, server_hostname=server_hostname)
File C:pythonsPython3.12.0Libssl.py:455, in SSLContext.wrap_socket(self, sock, server_side, do_handshake_on_connect, suppress_ragged_eofs, server_hostname, session)
449 def wrap_socket(self, sock, server_side=False,
450 do_handshake_on_connect=True,
451 suppress_ragged_eofs=True,
452 server_hostname=None, session=None):
453 # SSLSocket class handles server_hostname encoding before it calls
454 # ctx._wrap_socket()
--> 455 return self.sslsocket_class._create(
456 sock=sock,
457 server_side=server_side,
458 do_handshake_on_connect=do_handshake_on_connect,
459 suppress_ragged_eofs=suppress_ragged_eofs,
460 server_hostname=server_hostname,
461 context=self,
462 session=session
463 )
File C:pythonsPython3.12.0Libssl.py:1046, in SSLSocket._create(cls, sock, server_side, do_handshake_on_connect, suppress_ragged_eofs, server_hostname, context, session)
1045 raise ValueError("do_handshake_on_connect should not be specified for non-blocking sockets")
-> 1046 self.do_handshake()
1047 except (OSError, ValueError):
File C:pythonsPython3.12.0Libssl.py:1317, in SSLSocket.do_handshake(self, block)
1316 self.settimeout(None)
-> 1317 self._sslobj.do_handshake()
1318 finally:
TimeoutError: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
The above exception was the direct cause of the following exception:
ReadTimeoutError Traceback (most recent call last)
File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesrequestsadapters.py:589, in HTTPAdapter.send(self, request, stream, timeout, verify, cert, proxies)
588 try:
--> 589 resp = conn.urlopen(
590 method=request.method,
591 url=url,
592 body=request.body,
593 headers=request.headers,
594 redirect=False,
595 assert_same_host=False,
596 preload_content=False,
597 decode_content=False,
598 retries=self.max_retries,
599 timeout=timeout,
600 chunked=chunked,
601 )
603 except (ProtocolError, OSError) as err:
File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesurllib3connectionpool.py:843, in HTTPConnectionPool.urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, preload_content, decode_content, **response_kw)
841 new_e = ProtocolError("Connection aborted.", new_e)
--> 843 retries = retries.increment(
844 method, url, error=new_e, _pool=self, _stacktrace=sys.exc_info()[2]
845 )
846 retries.sleep()
File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesurllib3utilretry.py:474, in Retry.increment(self, method, url, response, error, _pool, _stacktrace)
473 if read is False or method is None or not self._is_method_retryable(method):
--> 474 raise reraise(type(error), error, _stacktrace)
475 elif read is not None:
File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesurllib3utilutil.py:39, in reraise(tp, value, tb)
38 raise value.with_traceback(tb)
---> 39 raise value
40 finally:
File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesurllib3connectionpool.py:789, in HTTPConnectionPool.urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, preload_content, decode_content, **response_kw)
788 # Make the request on the HTTPConnection object
--> 789 response = self._make_request(
790 conn,
791 method,
792 url,
793 timeout=timeout_obj,
794 body=body,
795 headers=headers,
796 chunked=chunked,
797 retries=retries,
798 response_conn=response_conn,
799 preload_content=preload_content,
800 decode_content=decode_content,
801 **response_kw,
802 )
804 # Everything went great!
File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesurllib3connectionpool.py:490, in HTTPConnectionPool._make_request(self, conn, method, url, body, headers, retries, timeout, chunked, response_conn, preload_content, decode_content, enforce_content_length)
489 new_e = _wrap_proxy_error(new_e, conn.proxy.scheme)
--> 490 raise new_e
492 # conn.request() calls http.client.*.request, not the method in
493 # urllib3.request. It also calls makefile (recv) on the socket.
File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesurllib3connectionpool.py:468, in HTTPConnectionPool._make_request(self, conn, method, url, body, headers, retries, timeout, chunked, response_conn, preload_content, decode_content, enforce_content_length)
467 except (SocketTimeout, BaseSSLError) as e:
--> 468 self._raise_timeout(err=e, url=url, timeout_value=conn.timeout)
469 raise
File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesurllib3connectionpool.py:369, in HTTPConnectionPool._raise_timeout(self, err, url, timeout_value)
368 if isinstance(err, SocketTimeout):
--> 369 raise ReadTimeoutError(
370 self, url, f"Read timed out. (read timeout={timeout_value})"
371 ) from err
373 # See the above comment about EAGAIN in Python 3.
ReadTimeoutError: HTTPSConnectionPool(host='api.binance.com', port=443): Read timed out. (read timeout=None)
During handling of the above exception, another exception occurred:
ReadTimeout Traceback (most recent call last)
Cell In[1], line 4
1 import requests
3 url = "https://api.binance.com/api/v3/exchangeInfo"
----> 4 response = requests.get(url)
5 print(response.status_code)
File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesrequestsapi.py:73, in get(url, params, **kwargs)
62 def get(url, params=None, **kwargs):
63 r"""Sends a GET request.
64
65 :param url: URL for the new :class:`Request` object.
(...)
70 :rtype: requests.Response
71 """
---> 73 return request("get", url, params=params, **kwargs)
File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesrequestsapi.py:59, in request(method, url, **kwargs)
55 # By using the 'with' statement we are sure the session is closed, thus we
56 # avoid leaving sockets open which can trigger a ResourceWarning in some
57 # cases, and look like a memory leak in others.
58 with sessions.Session() as session:
---> 59 return session.request(method=method, url=url, **kwargs)
File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesrequestssessions.py:589, in Session.request(self, method, url, params, data, headers, cookies, files, auth, timeout, allow_redirects, proxies, hooks, stream, verify, cert, json)
584 send_kwargs = {
585 "timeout": timeout,
586 "allow_redirects": allow_redirects,
587 }
588 send_kwargs.update(settings)
--> 589 resp = self.send(prep, **send_kwargs)
591 return resp
File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesrequestssessions.py:703, in Session.send(self, request, **kwargs)
700 start = preferred_clock()
702 # Send the request
--> 703 r = adapter.send(request, **kwargs)
705 # Total elapsed time of the request (approximately)
706 elapsed = preferred_clock() - start
File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesrequestsadapters.py:635, in HTTPAdapter.send(self, request, stream, timeout, verify, cert, proxies)
633 raise SSLError(e, request=request)
634 elif isinstance(e, ReadTimeoutError):
--> 635 raise ReadTimeout(e, request=request)
636 elif isinstance(e, _InvalidHeader):
637 raise InvalidHeader(e, request=request)
ReadTimeout: HTTPSConnectionPool(host='api.binance.com', port=443): Read timed out. (read timeout=None)
</code>
<code>--------------------------------------------------------------------------- TimeoutError Traceback (most recent call last) File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesurllib3connectionpool.py:466, in HTTPConnectionPool._make_request(self, conn, method, url, body, headers, retries, timeout, chunked, response_conn, preload_content, decode_content, enforce_content_length) 465 try: --> 466 self._validate_conn(conn) 467 except (SocketTimeout, BaseSSLError) as e: File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesurllib3connectionpool.py:1095, in HTTPSConnectionPool._validate_conn(self, conn) 1094 if conn.is_closed: -> 1095 conn.connect() 1097 # TODO revise this, see https://github.com/urllib3/urllib3/issues/2791 File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesurllib3connection.py:652, in HTTPSConnection.connect(self) 650 server_hostname_rm_dot = server_hostname.rstrip(".") --> 652 sock_and_verified = _ssl_wrap_socket_and_match_hostname( 653 sock=sock, 654 cert_reqs=self.cert_reqs, 655 ssl_version=self.ssl_version, 656 ssl_minimum_version=self.ssl_minimum_version, 657 ssl_maximum_version=self.ssl_maximum_version, 658 ca_certs=self.ca_certs, 659 ca_cert_dir=self.ca_cert_dir, 660 ca_cert_data=self.ca_cert_data, 661 cert_file=self.cert_file, 662 key_file=self.key_file, 663 key_password=self.key_password, 664 server_hostname=server_hostname_rm_dot, 665 ssl_context=self.ssl_context, 666 tls_in_tls=tls_in_tls, 667 assert_hostname=self.assert_hostname, 668 assert_fingerprint=self.assert_fingerprint, 669 ) 670 self.sock = sock_and_verified.socket File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesurllib3connection.py:805, in _ssl_wrap_socket_and_match_hostname(sock, cert_reqs, ssl_version, ssl_minimum_version, ssl_maximum_version, cert_file, key_file, key_password, ca_certs, ca_cert_dir, ca_cert_data, assert_hostname, assert_fingerprint, server_hostname, ssl_context, tls_in_tls) 803 server_hostname = normalized --> 805 ssl_sock = ssl_wrap_socket( 806 sock=sock, 807 keyfile=key_file, 808 certfile=cert_file, 809 key_password=key_password, 810 ca_certs=ca_certs, 811 ca_cert_dir=ca_cert_dir, 812 ca_cert_data=ca_cert_data, 813 server_hostname=server_hostname, 814 ssl_context=context, 815 tls_in_tls=tls_in_tls, 816 ) 818 try: File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesurllib3utilssl_.py:465, in ssl_wrap_socket(sock, keyfile, certfile, cert_reqs, ca_certs, server_hostname, ssl_version, ciphers, ssl_context, ca_cert_dir, key_password, ca_cert_data, tls_in_tls) 463 pass --> 465 ssl_sock = _ssl_wrap_socket_impl(sock, context, tls_in_tls, server_hostname) 466 return ssl_sock File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesurllib3utilssl_.py:509, in _ssl_wrap_socket_impl(sock, ssl_context, tls_in_tls, server_hostname) 507 return SSLTransport(sock, ssl_context, server_hostname) --> 509 return ssl_context.wrap_socket(sock, server_hostname=server_hostname) File C:pythonsPython3.12.0Libssl.py:455, in SSLContext.wrap_socket(self, sock, server_side, do_handshake_on_connect, suppress_ragged_eofs, server_hostname, session) 449 def wrap_socket(self, sock, server_side=False, 450 do_handshake_on_connect=True, 451 suppress_ragged_eofs=True, 452 server_hostname=None, session=None): 453 # SSLSocket class handles server_hostname encoding before it calls 454 # ctx._wrap_socket() --> 455 return self.sslsocket_class._create( 456 sock=sock, 457 server_side=server_side, 458 do_handshake_on_connect=do_handshake_on_connect, 459 suppress_ragged_eofs=suppress_ragged_eofs, 460 server_hostname=server_hostname, 461 context=self, 462 session=session 463 ) File C:pythonsPython3.12.0Libssl.py:1046, in SSLSocket._create(cls, sock, server_side, do_handshake_on_connect, suppress_ragged_eofs, server_hostname, context, session) 1045 raise ValueError("do_handshake_on_connect should not be specified for non-blocking sockets") -> 1046 self.do_handshake() 1047 except (OSError, ValueError): File C:pythonsPython3.12.0Libssl.py:1317, in SSLSocket.do_handshake(self, block) 1316 self.settimeout(None) -> 1317 self._sslobj.do_handshake() 1318 finally: TimeoutError: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond The above exception was the direct cause of the following exception: ReadTimeoutError Traceback (most recent call last) File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesrequestsadapters.py:589, in HTTPAdapter.send(self, request, stream, timeout, verify, cert, proxies) 588 try: --> 589 resp = conn.urlopen( 590 method=request.method, 591 url=url, 592 body=request.body, 593 headers=request.headers, 594 redirect=False, 595 assert_same_host=False, 596 preload_content=False, 597 decode_content=False, 598 retries=self.max_retries, 599 timeout=timeout, 600 chunked=chunked, 601 ) 603 except (ProtocolError, OSError) as err: File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesurllib3connectionpool.py:843, in HTTPConnectionPool.urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, preload_content, decode_content, **response_kw) 841 new_e = ProtocolError("Connection aborted.", new_e) --> 843 retries = retries.increment( 844 method, url, error=new_e, _pool=self, _stacktrace=sys.exc_info()[2] 845 ) 846 retries.sleep() File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesurllib3utilretry.py:474, in Retry.increment(self, method, url, response, error, _pool, _stacktrace) 473 if read is False or method is None or not self._is_method_retryable(method): --> 474 raise reraise(type(error), error, _stacktrace) 475 elif read is not None: File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesurllib3utilutil.py:39, in reraise(tp, value, tb) 38 raise value.with_traceback(tb) ---> 39 raise value 40 finally: File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesurllib3connectionpool.py:789, in HTTPConnectionPool.urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, preload_content, decode_content, **response_kw) 788 # Make the request on the HTTPConnection object --> 789 response = self._make_request( 790 conn, 791 method, 792 url, 793 timeout=timeout_obj, 794 body=body, 795 headers=headers, 796 chunked=chunked, 797 retries=retries, 798 response_conn=response_conn, 799 preload_content=preload_content, 800 decode_content=decode_content, 801 **response_kw, 802 ) 804 # Everything went great! File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesurllib3connectionpool.py:490, in HTTPConnectionPool._make_request(self, conn, method, url, body, headers, retries, timeout, chunked, response_conn, preload_content, decode_content, enforce_content_length) 489 new_e = _wrap_proxy_error(new_e, conn.proxy.scheme) --> 490 raise new_e 492 # conn.request() calls http.client.*.request, not the method in 493 # urllib3.request. It also calls makefile (recv) on the socket. File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesurllib3connectionpool.py:468, in HTTPConnectionPool._make_request(self, conn, method, url, body, headers, retries, timeout, chunked, response_conn, preload_content, decode_content, enforce_content_length) 467 except (SocketTimeout, BaseSSLError) as e: --> 468 self._raise_timeout(err=e, url=url, timeout_value=conn.timeout) 469 raise File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesurllib3connectionpool.py:369, in HTTPConnectionPool._raise_timeout(self, err, url, timeout_value) 368 if isinstance(err, SocketTimeout): --> 369 raise ReadTimeoutError( 370 self, url, f"Read timed out. (read timeout={timeout_value})" 371 ) from err 373 # See the above comment about EAGAIN in Python 3. ReadTimeoutError: HTTPSConnectionPool(host='api.binance.com', port=443): Read timed out. (read timeout=None) During handling of the above exception, another exception occurred: ReadTimeout Traceback (most recent call last) Cell In[1], line 4 1 import requests 3 url = "https://api.binance.com/api/v3/exchangeInfo" ----> 4 response = requests.get(url) 5 print(response.status_code) File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesrequestsapi.py:73, in get(url, params, **kwargs) 62 def get(url, params=None, **kwargs): 63 r"""Sends a GET request. 64 65 :param url: URL for the new :class:`Request` object. (...) 70 :rtype: requests.Response 71 """ ---> 73 return request("get", url, params=params, **kwargs) File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesrequestsapi.py:59, in request(method, url, **kwargs) 55 # By using the 'with' statement we are sure the session is closed, thus we 56 # avoid leaving sockets open which can trigger a ResourceWarning in some 57 # cases, and look like a memory leak in others. 58 with sessions.Session() as session: ---> 59 return session.request(method=method, url=url, **kwargs) File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesrequestssessions.py:589, in Session.request(self, method, url, params, data, headers, cookies, files, auth, timeout, allow_redirects, proxies, hooks, stream, verify, cert, json) 584 send_kwargs = { 585 "timeout": timeout, 586 "allow_redirects": allow_redirects, 587 } 588 send_kwargs.update(settings) --> 589 resp = self.send(prep, **send_kwargs) 591 return resp File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesrequestssessions.py:703, in Session.send(self, request, **kwargs) 700 start = preferred_clock() 702 # Send the request --> 703 r = adapter.send(request, **kwargs) 705 # Total elapsed time of the request (approximately) 706 elapsed = preferred_clock() - start File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesrequestsadapters.py:635, in HTTPAdapter.send(self, request, stream, timeout, verify, cert, proxies) 633 raise SSLError(e, request=request) 634 elif isinstance(e, ReadTimeoutError): --> 635 raise ReadTimeout(e, request=request) 636 elif isinstance(e, _InvalidHeader): 637 raise InvalidHeader(e, request=request) ReadTimeout: HTTPSConnectionPool(host='api.binance.com', port=443): Read timed out. (read timeout=None) </code>
---------------------------------------------------------------------------
TimeoutError                              Traceback (most recent call last)
File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesurllib3connectionpool.py:466, in HTTPConnectionPool._make_request(self, conn, method, url, body, headers, retries, timeout, chunked, response_conn, preload_content, decode_content, enforce_content_length)
    465 try:
--> 466     self._validate_conn(conn)
    467 except (SocketTimeout, BaseSSLError) as e:

File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesurllib3connectionpool.py:1095, in HTTPSConnectionPool._validate_conn(self, conn)
   1094 if conn.is_closed:
-> 1095     conn.connect()
   1097 # TODO revise this, see https://github.com/urllib3/urllib3/issues/2791

File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesurllib3connection.py:652, in HTTPSConnection.connect(self)
    650 server_hostname_rm_dot = server_hostname.rstrip(".")
--> 652 sock_and_verified = _ssl_wrap_socket_and_match_hostname(
    653     sock=sock,
    654     cert_reqs=self.cert_reqs,
    655     ssl_version=self.ssl_version,
    656     ssl_minimum_version=self.ssl_minimum_version,
    657     ssl_maximum_version=self.ssl_maximum_version,
    658     ca_certs=self.ca_certs,
    659     ca_cert_dir=self.ca_cert_dir,
    660     ca_cert_data=self.ca_cert_data,
    661     cert_file=self.cert_file,
    662     key_file=self.key_file,
    663     key_password=self.key_password,
    664     server_hostname=server_hostname_rm_dot,
    665     ssl_context=self.ssl_context,
    666     tls_in_tls=tls_in_tls,
    667     assert_hostname=self.assert_hostname,
    668     assert_fingerprint=self.assert_fingerprint,
    669 )
    670 self.sock = sock_and_verified.socket

File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesurllib3connection.py:805, in _ssl_wrap_socket_and_match_hostname(sock, cert_reqs, ssl_version, ssl_minimum_version, ssl_maximum_version, cert_file, key_file, key_password, ca_certs, ca_cert_dir, ca_cert_data, assert_hostname, assert_fingerprint, server_hostname, ssl_context, tls_in_tls)
    803         server_hostname = normalized
--> 805 ssl_sock = ssl_wrap_socket(
    806     sock=sock,
    807     keyfile=key_file,
    808     certfile=cert_file,
    809     key_password=key_password,
    810     ca_certs=ca_certs,
    811     ca_cert_dir=ca_cert_dir,
    812     ca_cert_data=ca_cert_data,
    813     server_hostname=server_hostname,
    814     ssl_context=context,
    815     tls_in_tls=tls_in_tls,
    816 )
    818 try:

File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesurllib3utilssl_.py:465, in ssl_wrap_socket(sock, keyfile, certfile, cert_reqs, ca_certs, server_hostname, ssl_version, ciphers, ssl_context, ca_cert_dir, key_password, ca_cert_data, tls_in_tls)
    463     pass
--> 465 ssl_sock = _ssl_wrap_socket_impl(sock, context, tls_in_tls, server_hostname)
    466 return ssl_sock

File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesurllib3utilssl_.py:509, in _ssl_wrap_socket_impl(sock, ssl_context, tls_in_tls, server_hostname)
    507     return SSLTransport(sock, ssl_context, server_hostname)
--> 509 return ssl_context.wrap_socket(sock, server_hostname=server_hostname)

File C:pythonsPython3.12.0Libssl.py:455, in SSLContext.wrap_socket(self, sock, server_side, do_handshake_on_connect, suppress_ragged_eofs, server_hostname, session)
    449 def wrap_socket(self, sock, server_side=False,
    450                 do_handshake_on_connect=True,
    451                 suppress_ragged_eofs=True,
    452                 server_hostname=None, session=None):
    453     # SSLSocket class handles server_hostname encoding before it calls
    454     # ctx._wrap_socket()
--> 455     return self.sslsocket_class._create(
    456         sock=sock,
    457         server_side=server_side,
    458         do_handshake_on_connect=do_handshake_on_connect,
    459         suppress_ragged_eofs=suppress_ragged_eofs,
    460         server_hostname=server_hostname,
    461         context=self,
    462         session=session
    463     )

File C:pythonsPython3.12.0Libssl.py:1046, in SSLSocket._create(cls, sock, server_side, do_handshake_on_connect, suppress_ragged_eofs, server_hostname, context, session)
   1045             raise ValueError("do_handshake_on_connect should not be specified for non-blocking sockets")
-> 1046         self.do_handshake()
   1047 except (OSError, ValueError):

File C:pythonsPython3.12.0Libssl.py:1317, in SSLSocket.do_handshake(self, block)
   1316         self.settimeout(None)
-> 1317     self._sslobj.do_handshake()
   1318 finally:

TimeoutError: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond

The above exception was the direct cause of the following exception:

ReadTimeoutError                          Traceback (most recent call last)
File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesrequestsadapters.py:589, in HTTPAdapter.send(self, request, stream, timeout, verify, cert, proxies)
    588 try:
--> 589     resp = conn.urlopen(
    590         method=request.method,
    591         url=url,
    592         body=request.body,
    593         headers=request.headers,
    594         redirect=False,
    595         assert_same_host=False,
    596         preload_content=False,
    597         decode_content=False,
    598         retries=self.max_retries,
    599         timeout=timeout,
    600         chunked=chunked,
    601     )
    603 except (ProtocolError, OSError) as err:

File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesurllib3connectionpool.py:843, in HTTPConnectionPool.urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, preload_content, decode_content, **response_kw)
    841     new_e = ProtocolError("Connection aborted.", new_e)
--> 843 retries = retries.increment(
    844     method, url, error=new_e, _pool=self, _stacktrace=sys.exc_info()[2]
    845 )
    846 retries.sleep()

File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesurllib3utilretry.py:474, in Retry.increment(self, method, url, response, error, _pool, _stacktrace)
    473 if read is False or method is None or not self._is_method_retryable(method):
--> 474     raise reraise(type(error), error, _stacktrace)
    475 elif read is not None:

File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesurllib3utilutil.py:39, in reraise(tp, value, tb)
     38         raise value.with_traceback(tb)
---> 39     raise value
     40 finally:

File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesurllib3connectionpool.py:789, in HTTPConnectionPool.urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, preload_content, decode_content, **response_kw)
    788 # Make the request on the HTTPConnection object
--> 789 response = self._make_request(
    790     conn,
    791     method,
    792     url,
    793     timeout=timeout_obj,
    794     body=body,
    795     headers=headers,
    796     chunked=chunked,
    797     retries=retries,
    798     response_conn=response_conn,
    799     preload_content=preload_content,
    800     decode_content=decode_content,
    801     **response_kw,
    802 )
    804 # Everything went great!

File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesurllib3connectionpool.py:490, in HTTPConnectionPool._make_request(self, conn, method, url, body, headers, retries, timeout, chunked, response_conn, preload_content, decode_content, enforce_content_length)
    489         new_e = _wrap_proxy_error(new_e, conn.proxy.scheme)
--> 490     raise new_e
    492 # conn.request() calls http.client.*.request, not the method in
    493 # urllib3.request. It also calls makefile (recv) on the socket.

File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesurllib3connectionpool.py:468, in HTTPConnectionPool._make_request(self, conn, method, url, body, headers, retries, timeout, chunked, response_conn, preload_content, decode_content, enforce_content_length)
    467 except (SocketTimeout, BaseSSLError) as e:
--> 468     self._raise_timeout(err=e, url=url, timeout_value=conn.timeout)
    469     raise

File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesurllib3connectionpool.py:369, in HTTPConnectionPool._raise_timeout(self, err, url, timeout_value)
    368 if isinstance(err, SocketTimeout):
--> 369     raise ReadTimeoutError(
    370         self, url, f"Read timed out. (read timeout={timeout_value})"
    371     ) from err
    373 # See the above comment about EAGAIN in Python 3.

ReadTimeoutError: HTTPSConnectionPool(host='api.binance.com', port=443): Read timed out. (read timeout=None)

During handling of the above exception, another exception occurred:

ReadTimeout                               Traceback (most recent call last)
Cell In[1], line 4
      1 import requests
      3 url = "https://api.binance.com/api/v3/exchangeInfo"
----> 4 response = requests.get(url)
      5 print(response.status_code)

File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesrequestsapi.py:73, in get(url, params, **kwargs)
     62 def get(url, params=None, **kwargs):
     63     r"""Sends a GET request.
     64 
     65     :param url: URL for the new :class:`Request` object.
   (...)
     70     :rtype: requests.Response
     71     """
---> 73     return request("get", url, params=params, **kwargs)

File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesrequestsapi.py:59, in request(method, url, **kwargs)
     55 # By using the 'with' statement we are sure the session is closed, thus we
     56 # avoid leaving sockets open which can trigger a ResourceWarning in some
     57 # cases, and look like a memory leak in others.
     58 with sessions.Session() as session:
---> 59     return session.request(method=method, url=url, **kwargs)

File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesrequestssessions.py:589, in Session.request(self, method, url, params, data, headers, cookies, files, auth, timeout, allow_redirects, proxies, hooks, stream, verify, cert, json)
    584 send_kwargs = {
    585     "timeout": timeout,
    586     "allow_redirects": allow_redirects,
    587 }
    588 send_kwargs.update(settings)
--> 589 resp = self.send(prep, **send_kwargs)
    591 return resp

File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesrequestssessions.py:703, in Session.send(self, request, **kwargs)
    700 start = preferred_clock()
    702 # Send the request
--> 703 r = adapter.send(request, **kwargs)
    705 # Total elapsed time of the request (approximately)
    706 elapsed = preferred_clock() - start

File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesrequestsadapters.py:635, in HTTPAdapter.send(self, request, stream, timeout, verify, cert, proxies)
    633     raise SSLError(e, request=request)
    634 elif isinstance(e, ReadTimeoutError):
--> 635     raise ReadTimeout(e, request=request)
    636 elif isinstance(e, _InvalidHeader):
    637     raise InvalidHeader(e, request=request)

ReadTimeout: HTTPSConnectionPool(host='api.binance.com', port=443): Read timed out. (read timeout=None)

What could be causing this issue? Is it related to the Binance API, or could it be due to the internet blackout? What can I do to resolve this?

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa

ReadTimeout: HTTPSConnectionPool(host=’api.binance.com’, port=443): Read timed out. (read timeout=None)

I am working on an algorithmic trading project using the Binance API. The API was working fine until the recent internet blackout in Bangladesh. However, even after the internet was restored, the Binance API still isn’t functioning in my project. I consistently receive a timeout error when making requests.

I have tried using 5-6 different Python libraries and 3 Node.js libraries to connect to the Binance server, but nothing has worked. Despite this, the API is working fine in the Google Chrome browser, and I can access it via the browser’s developer console.

Here is a code snippet from my project:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>url = "https://api.binance.com/api/v3/exchangeInfo"
response = requests.get(url)
print(response.status_code)
</code>
<code>url = "https://api.binance.com/api/v3/exchangeInfo" response = requests.get(url) print(response.status_code) </code>
url = "https://api.binance.com/api/v3/exchangeInfo"
response = requests.get(url)
print(response.status_code)

Here is the error:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>---------------------------------------------------------------------------
TimeoutError Traceback (most recent call last)
File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesurllib3connectionpool.py:466, in HTTPConnectionPool._make_request(self, conn, method, url, body, headers, retries, timeout, chunked, response_conn, preload_content, decode_content, enforce_content_length)
465 try:
--> 466 self._validate_conn(conn)
467 except (SocketTimeout, BaseSSLError) as e:
File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesurllib3connectionpool.py:1095, in HTTPSConnectionPool._validate_conn(self, conn)
1094 if conn.is_closed:
-> 1095 conn.connect()
1097 # TODO revise this, see https://github.com/urllib3/urllib3/issues/2791
File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesurllib3connection.py:652, in HTTPSConnection.connect(self)
650 server_hostname_rm_dot = server_hostname.rstrip(".")
--> 652 sock_and_verified = _ssl_wrap_socket_and_match_hostname(
653 sock=sock,
654 cert_reqs=self.cert_reqs,
655 ssl_version=self.ssl_version,
656 ssl_minimum_version=self.ssl_minimum_version,
657 ssl_maximum_version=self.ssl_maximum_version,
658 ca_certs=self.ca_certs,
659 ca_cert_dir=self.ca_cert_dir,
660 ca_cert_data=self.ca_cert_data,
661 cert_file=self.cert_file,
662 key_file=self.key_file,
663 key_password=self.key_password,
664 server_hostname=server_hostname_rm_dot,
665 ssl_context=self.ssl_context,
666 tls_in_tls=tls_in_tls,
667 assert_hostname=self.assert_hostname,
668 assert_fingerprint=self.assert_fingerprint,
669 )
670 self.sock = sock_and_verified.socket
File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesurllib3connection.py:805, in _ssl_wrap_socket_and_match_hostname(sock, cert_reqs, ssl_version, ssl_minimum_version, ssl_maximum_version, cert_file, key_file, key_password, ca_certs, ca_cert_dir, ca_cert_data, assert_hostname, assert_fingerprint, server_hostname, ssl_context, tls_in_tls)
803 server_hostname = normalized
--> 805 ssl_sock = ssl_wrap_socket(
806 sock=sock,
807 keyfile=key_file,
808 certfile=cert_file,
809 key_password=key_password,
810 ca_certs=ca_certs,
811 ca_cert_dir=ca_cert_dir,
812 ca_cert_data=ca_cert_data,
813 server_hostname=server_hostname,
814 ssl_context=context,
815 tls_in_tls=tls_in_tls,
816 )
818 try:
File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesurllib3utilssl_.py:465, in ssl_wrap_socket(sock, keyfile, certfile, cert_reqs, ca_certs, server_hostname, ssl_version, ciphers, ssl_context, ca_cert_dir, key_password, ca_cert_data, tls_in_tls)
463 pass
--> 465 ssl_sock = _ssl_wrap_socket_impl(sock, context, tls_in_tls, server_hostname)
466 return ssl_sock
File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesurllib3utilssl_.py:509, in _ssl_wrap_socket_impl(sock, ssl_context, tls_in_tls, server_hostname)
507 return SSLTransport(sock, ssl_context, server_hostname)
--> 509 return ssl_context.wrap_socket(sock, server_hostname=server_hostname)
File C:pythonsPython3.12.0Libssl.py:455, in SSLContext.wrap_socket(self, sock, server_side, do_handshake_on_connect, suppress_ragged_eofs, server_hostname, session)
449 def wrap_socket(self, sock, server_side=False,
450 do_handshake_on_connect=True,
451 suppress_ragged_eofs=True,
452 server_hostname=None, session=None):
453 # SSLSocket class handles server_hostname encoding before it calls
454 # ctx._wrap_socket()
--> 455 return self.sslsocket_class._create(
456 sock=sock,
457 server_side=server_side,
458 do_handshake_on_connect=do_handshake_on_connect,
459 suppress_ragged_eofs=suppress_ragged_eofs,
460 server_hostname=server_hostname,
461 context=self,
462 session=session
463 )
File C:pythonsPython3.12.0Libssl.py:1046, in SSLSocket._create(cls, sock, server_side, do_handshake_on_connect, suppress_ragged_eofs, server_hostname, context, session)
1045 raise ValueError("do_handshake_on_connect should not be specified for non-blocking sockets")
-> 1046 self.do_handshake()
1047 except (OSError, ValueError):
File C:pythonsPython3.12.0Libssl.py:1317, in SSLSocket.do_handshake(self, block)
1316 self.settimeout(None)
-> 1317 self._sslobj.do_handshake()
1318 finally:
TimeoutError: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
The above exception was the direct cause of the following exception:
ReadTimeoutError Traceback (most recent call last)
File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesrequestsadapters.py:589, in HTTPAdapter.send(self, request, stream, timeout, verify, cert, proxies)
588 try:
--> 589 resp = conn.urlopen(
590 method=request.method,
591 url=url,
592 body=request.body,
593 headers=request.headers,
594 redirect=False,
595 assert_same_host=False,
596 preload_content=False,
597 decode_content=False,
598 retries=self.max_retries,
599 timeout=timeout,
600 chunked=chunked,
601 )
603 except (ProtocolError, OSError) as err:
File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesurllib3connectionpool.py:843, in HTTPConnectionPool.urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, preload_content, decode_content, **response_kw)
841 new_e = ProtocolError("Connection aborted.", new_e)
--> 843 retries = retries.increment(
844 method, url, error=new_e, _pool=self, _stacktrace=sys.exc_info()[2]
845 )
846 retries.sleep()
File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesurllib3utilretry.py:474, in Retry.increment(self, method, url, response, error, _pool, _stacktrace)
473 if read is False or method is None or not self._is_method_retryable(method):
--> 474 raise reraise(type(error), error, _stacktrace)
475 elif read is not None:
File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesurllib3utilutil.py:39, in reraise(tp, value, tb)
38 raise value.with_traceback(tb)
---> 39 raise value
40 finally:
File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesurllib3connectionpool.py:789, in HTTPConnectionPool.urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, preload_content, decode_content, **response_kw)
788 # Make the request on the HTTPConnection object
--> 789 response = self._make_request(
790 conn,
791 method,
792 url,
793 timeout=timeout_obj,
794 body=body,
795 headers=headers,
796 chunked=chunked,
797 retries=retries,
798 response_conn=response_conn,
799 preload_content=preload_content,
800 decode_content=decode_content,
801 **response_kw,
802 )
804 # Everything went great!
File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesurllib3connectionpool.py:490, in HTTPConnectionPool._make_request(self, conn, method, url, body, headers, retries, timeout, chunked, response_conn, preload_content, decode_content, enforce_content_length)
489 new_e = _wrap_proxy_error(new_e, conn.proxy.scheme)
--> 490 raise new_e
492 # conn.request() calls http.client.*.request, not the method in
493 # urllib3.request. It also calls makefile (recv) on the socket.
File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesurllib3connectionpool.py:468, in HTTPConnectionPool._make_request(self, conn, method, url, body, headers, retries, timeout, chunked, response_conn, preload_content, decode_content, enforce_content_length)
467 except (SocketTimeout, BaseSSLError) as e:
--> 468 self._raise_timeout(err=e, url=url, timeout_value=conn.timeout)
469 raise
File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesurllib3connectionpool.py:369, in HTTPConnectionPool._raise_timeout(self, err, url, timeout_value)
368 if isinstance(err, SocketTimeout):
--> 369 raise ReadTimeoutError(
370 self, url, f"Read timed out. (read timeout={timeout_value})"
371 ) from err
373 # See the above comment about EAGAIN in Python 3.
ReadTimeoutError: HTTPSConnectionPool(host='api.binance.com', port=443): Read timed out. (read timeout=None)
During handling of the above exception, another exception occurred:
ReadTimeout Traceback (most recent call last)
Cell In[1], line 4
1 import requests
3 url = "https://api.binance.com/api/v3/exchangeInfo"
----> 4 response = requests.get(url)
5 print(response.status_code)
File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesrequestsapi.py:73, in get(url, params, **kwargs)
62 def get(url, params=None, **kwargs):
63 r"""Sends a GET request.
64
65 :param url: URL for the new :class:`Request` object.
(...)
70 :rtype: requests.Response
71 """
---> 73 return request("get", url, params=params, **kwargs)
File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesrequestsapi.py:59, in request(method, url, **kwargs)
55 # By using the 'with' statement we are sure the session is closed, thus we
56 # avoid leaving sockets open which can trigger a ResourceWarning in some
57 # cases, and look like a memory leak in others.
58 with sessions.Session() as session:
---> 59 return session.request(method=method, url=url, **kwargs)
File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesrequestssessions.py:589, in Session.request(self, method, url, params, data, headers, cookies, files, auth, timeout, allow_redirects, proxies, hooks, stream, verify, cert, json)
584 send_kwargs = {
585 "timeout": timeout,
586 "allow_redirects": allow_redirects,
587 }
588 send_kwargs.update(settings)
--> 589 resp = self.send(prep, **send_kwargs)
591 return resp
File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesrequestssessions.py:703, in Session.send(self, request, **kwargs)
700 start = preferred_clock()
702 # Send the request
--> 703 r = adapter.send(request, **kwargs)
705 # Total elapsed time of the request (approximately)
706 elapsed = preferred_clock() - start
File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesrequestsadapters.py:635, in HTTPAdapter.send(self, request, stream, timeout, verify, cert, proxies)
633 raise SSLError(e, request=request)
634 elif isinstance(e, ReadTimeoutError):
--> 635 raise ReadTimeout(e, request=request)
636 elif isinstance(e, _InvalidHeader):
637 raise InvalidHeader(e, request=request)
ReadTimeout: HTTPSConnectionPool(host='api.binance.com', port=443): Read timed out. (read timeout=None)
</code>
<code>--------------------------------------------------------------------------- TimeoutError Traceback (most recent call last) File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesurllib3connectionpool.py:466, in HTTPConnectionPool._make_request(self, conn, method, url, body, headers, retries, timeout, chunked, response_conn, preload_content, decode_content, enforce_content_length) 465 try: --> 466 self._validate_conn(conn) 467 except (SocketTimeout, BaseSSLError) as e: File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesurllib3connectionpool.py:1095, in HTTPSConnectionPool._validate_conn(self, conn) 1094 if conn.is_closed: -> 1095 conn.connect() 1097 # TODO revise this, see https://github.com/urllib3/urllib3/issues/2791 File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesurllib3connection.py:652, in HTTPSConnection.connect(self) 650 server_hostname_rm_dot = server_hostname.rstrip(".") --> 652 sock_and_verified = _ssl_wrap_socket_and_match_hostname( 653 sock=sock, 654 cert_reqs=self.cert_reqs, 655 ssl_version=self.ssl_version, 656 ssl_minimum_version=self.ssl_minimum_version, 657 ssl_maximum_version=self.ssl_maximum_version, 658 ca_certs=self.ca_certs, 659 ca_cert_dir=self.ca_cert_dir, 660 ca_cert_data=self.ca_cert_data, 661 cert_file=self.cert_file, 662 key_file=self.key_file, 663 key_password=self.key_password, 664 server_hostname=server_hostname_rm_dot, 665 ssl_context=self.ssl_context, 666 tls_in_tls=tls_in_tls, 667 assert_hostname=self.assert_hostname, 668 assert_fingerprint=self.assert_fingerprint, 669 ) 670 self.sock = sock_and_verified.socket File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesurllib3connection.py:805, in _ssl_wrap_socket_and_match_hostname(sock, cert_reqs, ssl_version, ssl_minimum_version, ssl_maximum_version, cert_file, key_file, key_password, ca_certs, ca_cert_dir, ca_cert_data, assert_hostname, assert_fingerprint, server_hostname, ssl_context, tls_in_tls) 803 server_hostname = normalized --> 805 ssl_sock = ssl_wrap_socket( 806 sock=sock, 807 keyfile=key_file, 808 certfile=cert_file, 809 key_password=key_password, 810 ca_certs=ca_certs, 811 ca_cert_dir=ca_cert_dir, 812 ca_cert_data=ca_cert_data, 813 server_hostname=server_hostname, 814 ssl_context=context, 815 tls_in_tls=tls_in_tls, 816 ) 818 try: File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesurllib3utilssl_.py:465, in ssl_wrap_socket(sock, keyfile, certfile, cert_reqs, ca_certs, server_hostname, ssl_version, ciphers, ssl_context, ca_cert_dir, key_password, ca_cert_data, tls_in_tls) 463 pass --> 465 ssl_sock = _ssl_wrap_socket_impl(sock, context, tls_in_tls, server_hostname) 466 return ssl_sock File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesurllib3utilssl_.py:509, in _ssl_wrap_socket_impl(sock, ssl_context, tls_in_tls, server_hostname) 507 return SSLTransport(sock, ssl_context, server_hostname) --> 509 return ssl_context.wrap_socket(sock, server_hostname=server_hostname) File C:pythonsPython3.12.0Libssl.py:455, in SSLContext.wrap_socket(self, sock, server_side, do_handshake_on_connect, suppress_ragged_eofs, server_hostname, session) 449 def wrap_socket(self, sock, server_side=False, 450 do_handshake_on_connect=True, 451 suppress_ragged_eofs=True, 452 server_hostname=None, session=None): 453 # SSLSocket class handles server_hostname encoding before it calls 454 # ctx._wrap_socket() --> 455 return self.sslsocket_class._create( 456 sock=sock, 457 server_side=server_side, 458 do_handshake_on_connect=do_handshake_on_connect, 459 suppress_ragged_eofs=suppress_ragged_eofs, 460 server_hostname=server_hostname, 461 context=self, 462 session=session 463 ) File C:pythonsPython3.12.0Libssl.py:1046, in SSLSocket._create(cls, sock, server_side, do_handshake_on_connect, suppress_ragged_eofs, server_hostname, context, session) 1045 raise ValueError("do_handshake_on_connect should not be specified for non-blocking sockets") -> 1046 self.do_handshake() 1047 except (OSError, ValueError): File C:pythonsPython3.12.0Libssl.py:1317, in SSLSocket.do_handshake(self, block) 1316 self.settimeout(None) -> 1317 self._sslobj.do_handshake() 1318 finally: TimeoutError: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond The above exception was the direct cause of the following exception: ReadTimeoutError Traceback (most recent call last) File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesrequestsadapters.py:589, in HTTPAdapter.send(self, request, stream, timeout, verify, cert, proxies) 588 try: --> 589 resp = conn.urlopen( 590 method=request.method, 591 url=url, 592 body=request.body, 593 headers=request.headers, 594 redirect=False, 595 assert_same_host=False, 596 preload_content=False, 597 decode_content=False, 598 retries=self.max_retries, 599 timeout=timeout, 600 chunked=chunked, 601 ) 603 except (ProtocolError, OSError) as err: File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesurllib3connectionpool.py:843, in HTTPConnectionPool.urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, preload_content, decode_content, **response_kw) 841 new_e = ProtocolError("Connection aborted.", new_e) --> 843 retries = retries.increment( 844 method, url, error=new_e, _pool=self, _stacktrace=sys.exc_info()[2] 845 ) 846 retries.sleep() File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesurllib3utilretry.py:474, in Retry.increment(self, method, url, response, error, _pool, _stacktrace) 473 if read is False or method is None or not self._is_method_retryable(method): --> 474 raise reraise(type(error), error, _stacktrace) 475 elif read is not None: File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesurllib3utilutil.py:39, in reraise(tp, value, tb) 38 raise value.with_traceback(tb) ---> 39 raise value 40 finally: File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesurllib3connectionpool.py:789, in HTTPConnectionPool.urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, preload_content, decode_content, **response_kw) 788 # Make the request on the HTTPConnection object --> 789 response = self._make_request( 790 conn, 791 method, 792 url, 793 timeout=timeout_obj, 794 body=body, 795 headers=headers, 796 chunked=chunked, 797 retries=retries, 798 response_conn=response_conn, 799 preload_content=preload_content, 800 decode_content=decode_content, 801 **response_kw, 802 ) 804 # Everything went great! File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesurllib3connectionpool.py:490, in HTTPConnectionPool._make_request(self, conn, method, url, body, headers, retries, timeout, chunked, response_conn, preload_content, decode_content, enforce_content_length) 489 new_e = _wrap_proxy_error(new_e, conn.proxy.scheme) --> 490 raise new_e 492 # conn.request() calls http.client.*.request, not the method in 493 # urllib3.request. It also calls makefile (recv) on the socket. File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesurllib3connectionpool.py:468, in HTTPConnectionPool._make_request(self, conn, method, url, body, headers, retries, timeout, chunked, response_conn, preload_content, decode_content, enforce_content_length) 467 except (SocketTimeout, BaseSSLError) as e: --> 468 self._raise_timeout(err=e, url=url, timeout_value=conn.timeout) 469 raise File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesurllib3connectionpool.py:369, in HTTPConnectionPool._raise_timeout(self, err, url, timeout_value) 368 if isinstance(err, SocketTimeout): --> 369 raise ReadTimeoutError( 370 self, url, f"Read timed out. (read timeout={timeout_value})" 371 ) from err 373 # See the above comment about EAGAIN in Python 3. ReadTimeoutError: HTTPSConnectionPool(host='api.binance.com', port=443): Read timed out. (read timeout=None) During handling of the above exception, another exception occurred: ReadTimeout Traceback (most recent call last) Cell In[1], line 4 1 import requests 3 url = "https://api.binance.com/api/v3/exchangeInfo" ----> 4 response = requests.get(url) 5 print(response.status_code) File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesrequestsapi.py:73, in get(url, params, **kwargs) 62 def get(url, params=None, **kwargs): 63 r"""Sends a GET request. 64 65 :param url: URL for the new :class:`Request` object. (...) 70 :rtype: requests.Response 71 """ ---> 73 return request("get", url, params=params, **kwargs) File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesrequestsapi.py:59, in request(method, url, **kwargs) 55 # By using the 'with' statement we are sure the session is closed, thus we 56 # avoid leaving sockets open which can trigger a ResourceWarning in some 57 # cases, and look like a memory leak in others. 58 with sessions.Session() as session: ---> 59 return session.request(method=method, url=url, **kwargs) File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesrequestssessions.py:589, in Session.request(self, method, url, params, data, headers, cookies, files, auth, timeout, allow_redirects, proxies, hooks, stream, verify, cert, json) 584 send_kwargs = { 585 "timeout": timeout, 586 "allow_redirects": allow_redirects, 587 } 588 send_kwargs.update(settings) --> 589 resp = self.send(prep, **send_kwargs) 591 return resp File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesrequestssessions.py:703, in Session.send(self, request, **kwargs) 700 start = preferred_clock() 702 # Send the request --> 703 r = adapter.send(request, **kwargs) 705 # Total elapsed time of the request (approximately) 706 elapsed = preferred_clock() - start File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesrequestsadapters.py:635, in HTTPAdapter.send(self, request, stream, timeout, verify, cert, proxies) 633 raise SSLError(e, request=request) 634 elif isinstance(e, ReadTimeoutError): --> 635 raise ReadTimeout(e, request=request) 636 elif isinstance(e, _InvalidHeader): 637 raise InvalidHeader(e, request=request) ReadTimeout: HTTPSConnectionPool(host='api.binance.com', port=443): Read timed out. (read timeout=None) </code>
---------------------------------------------------------------------------
TimeoutError                              Traceback (most recent call last)
File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesurllib3connectionpool.py:466, in HTTPConnectionPool._make_request(self, conn, method, url, body, headers, retries, timeout, chunked, response_conn, preload_content, decode_content, enforce_content_length)
    465 try:
--> 466     self._validate_conn(conn)
    467 except (SocketTimeout, BaseSSLError) as e:

File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesurllib3connectionpool.py:1095, in HTTPSConnectionPool._validate_conn(self, conn)
   1094 if conn.is_closed:
-> 1095     conn.connect()
   1097 # TODO revise this, see https://github.com/urllib3/urllib3/issues/2791

File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesurllib3connection.py:652, in HTTPSConnection.connect(self)
    650 server_hostname_rm_dot = server_hostname.rstrip(".")
--> 652 sock_and_verified = _ssl_wrap_socket_and_match_hostname(
    653     sock=sock,
    654     cert_reqs=self.cert_reqs,
    655     ssl_version=self.ssl_version,
    656     ssl_minimum_version=self.ssl_minimum_version,
    657     ssl_maximum_version=self.ssl_maximum_version,
    658     ca_certs=self.ca_certs,
    659     ca_cert_dir=self.ca_cert_dir,
    660     ca_cert_data=self.ca_cert_data,
    661     cert_file=self.cert_file,
    662     key_file=self.key_file,
    663     key_password=self.key_password,
    664     server_hostname=server_hostname_rm_dot,
    665     ssl_context=self.ssl_context,
    666     tls_in_tls=tls_in_tls,
    667     assert_hostname=self.assert_hostname,
    668     assert_fingerprint=self.assert_fingerprint,
    669 )
    670 self.sock = sock_and_verified.socket

File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesurllib3connection.py:805, in _ssl_wrap_socket_and_match_hostname(sock, cert_reqs, ssl_version, ssl_minimum_version, ssl_maximum_version, cert_file, key_file, key_password, ca_certs, ca_cert_dir, ca_cert_data, assert_hostname, assert_fingerprint, server_hostname, ssl_context, tls_in_tls)
    803         server_hostname = normalized
--> 805 ssl_sock = ssl_wrap_socket(
    806     sock=sock,
    807     keyfile=key_file,
    808     certfile=cert_file,
    809     key_password=key_password,
    810     ca_certs=ca_certs,
    811     ca_cert_dir=ca_cert_dir,
    812     ca_cert_data=ca_cert_data,
    813     server_hostname=server_hostname,
    814     ssl_context=context,
    815     tls_in_tls=tls_in_tls,
    816 )
    818 try:

File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesurllib3utilssl_.py:465, in ssl_wrap_socket(sock, keyfile, certfile, cert_reqs, ca_certs, server_hostname, ssl_version, ciphers, ssl_context, ca_cert_dir, key_password, ca_cert_data, tls_in_tls)
    463     pass
--> 465 ssl_sock = _ssl_wrap_socket_impl(sock, context, tls_in_tls, server_hostname)
    466 return ssl_sock

File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesurllib3utilssl_.py:509, in _ssl_wrap_socket_impl(sock, ssl_context, tls_in_tls, server_hostname)
    507     return SSLTransport(sock, ssl_context, server_hostname)
--> 509 return ssl_context.wrap_socket(sock, server_hostname=server_hostname)

File C:pythonsPython3.12.0Libssl.py:455, in SSLContext.wrap_socket(self, sock, server_side, do_handshake_on_connect, suppress_ragged_eofs, server_hostname, session)
    449 def wrap_socket(self, sock, server_side=False,
    450                 do_handshake_on_connect=True,
    451                 suppress_ragged_eofs=True,
    452                 server_hostname=None, session=None):
    453     # SSLSocket class handles server_hostname encoding before it calls
    454     # ctx._wrap_socket()
--> 455     return self.sslsocket_class._create(
    456         sock=sock,
    457         server_side=server_side,
    458         do_handshake_on_connect=do_handshake_on_connect,
    459         suppress_ragged_eofs=suppress_ragged_eofs,
    460         server_hostname=server_hostname,
    461         context=self,
    462         session=session
    463     )

File C:pythonsPython3.12.0Libssl.py:1046, in SSLSocket._create(cls, sock, server_side, do_handshake_on_connect, suppress_ragged_eofs, server_hostname, context, session)
   1045             raise ValueError("do_handshake_on_connect should not be specified for non-blocking sockets")
-> 1046         self.do_handshake()
   1047 except (OSError, ValueError):

File C:pythonsPython3.12.0Libssl.py:1317, in SSLSocket.do_handshake(self, block)
   1316         self.settimeout(None)
-> 1317     self._sslobj.do_handshake()
   1318 finally:

TimeoutError: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond

The above exception was the direct cause of the following exception:

ReadTimeoutError                          Traceback (most recent call last)
File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesrequestsadapters.py:589, in HTTPAdapter.send(self, request, stream, timeout, verify, cert, proxies)
    588 try:
--> 589     resp = conn.urlopen(
    590         method=request.method,
    591         url=url,
    592         body=request.body,
    593         headers=request.headers,
    594         redirect=False,
    595         assert_same_host=False,
    596         preload_content=False,
    597         decode_content=False,
    598         retries=self.max_retries,
    599         timeout=timeout,
    600         chunked=chunked,
    601     )
    603 except (ProtocolError, OSError) as err:

File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesurllib3connectionpool.py:843, in HTTPConnectionPool.urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, preload_content, decode_content, **response_kw)
    841     new_e = ProtocolError("Connection aborted.", new_e)
--> 843 retries = retries.increment(
    844     method, url, error=new_e, _pool=self, _stacktrace=sys.exc_info()[2]
    845 )
    846 retries.sleep()

File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesurllib3utilretry.py:474, in Retry.increment(self, method, url, response, error, _pool, _stacktrace)
    473 if read is False or method is None or not self._is_method_retryable(method):
--> 474     raise reraise(type(error), error, _stacktrace)
    475 elif read is not None:

File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesurllib3utilutil.py:39, in reraise(tp, value, tb)
     38         raise value.with_traceback(tb)
---> 39     raise value
     40 finally:

File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesurllib3connectionpool.py:789, in HTTPConnectionPool.urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, preload_content, decode_content, **response_kw)
    788 # Make the request on the HTTPConnection object
--> 789 response = self._make_request(
    790     conn,
    791     method,
    792     url,
    793     timeout=timeout_obj,
    794     body=body,
    795     headers=headers,
    796     chunked=chunked,
    797     retries=retries,
    798     response_conn=response_conn,
    799     preload_content=preload_content,
    800     decode_content=decode_content,
    801     **response_kw,
    802 )
    804 # Everything went great!

File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesurllib3connectionpool.py:490, in HTTPConnectionPool._make_request(self, conn, method, url, body, headers, retries, timeout, chunked, response_conn, preload_content, decode_content, enforce_content_length)
    489         new_e = _wrap_proxy_error(new_e, conn.proxy.scheme)
--> 490     raise new_e
    492 # conn.request() calls http.client.*.request, not the method in
    493 # urllib3.request. It also calls makefile (recv) on the socket.

File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesurllib3connectionpool.py:468, in HTTPConnectionPool._make_request(self, conn, method, url, body, headers, retries, timeout, chunked, response_conn, preload_content, decode_content, enforce_content_length)
    467 except (SocketTimeout, BaseSSLError) as e:
--> 468     self._raise_timeout(err=e, url=url, timeout_value=conn.timeout)
    469     raise

File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesurllib3connectionpool.py:369, in HTTPConnectionPool._raise_timeout(self, err, url, timeout_value)
    368 if isinstance(err, SocketTimeout):
--> 369     raise ReadTimeoutError(
    370         self, url, f"Read timed out. (read timeout={timeout_value})"
    371     ) from err
    373 # See the above comment about EAGAIN in Python 3.

ReadTimeoutError: HTTPSConnectionPool(host='api.binance.com', port=443): Read timed out. (read timeout=None)

During handling of the above exception, another exception occurred:

ReadTimeout                               Traceback (most recent call last)
Cell In[1], line 4
      1 import requests
      3 url = "https://api.binance.com/api/v3/exchangeInfo"
----> 4 response = requests.get(url)
      5 print(response.status_code)

File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesrequestsapi.py:73, in get(url, params, **kwargs)
     62 def get(url, params=None, **kwargs):
     63     r"""Sends a GET request.
     64 
     65     :param url: URL for the new :class:`Request` object.
   (...)
     70     :rtype: requests.Response
     71     """
---> 73     return request("get", url, params=params, **kwargs)

File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesrequestsapi.py:59, in request(method, url, **kwargs)
     55 # By using the 'with' statement we are sure the session is closed, thus we
     56 # avoid leaving sockets open which can trigger a ResourceWarning in some
     57 # cases, and look like a memory leak in others.
     58 with sessions.Session() as session:
---> 59     return session.request(method=method, url=url, **kwargs)

File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesrequestssessions.py:589, in Session.request(self, method, url, params, data, headers, cookies, files, auth, timeout, allow_redirects, proxies, hooks, stream, verify, cert, json)
    584 send_kwargs = {
    585     "timeout": timeout,
    586     "allow_redirects": allow_redirects,
    587 }
    588 send_kwargs.update(settings)
--> 589 resp = self.send(prep, **send_kwargs)
    591 return resp

File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesrequestssessions.py:703, in Session.send(self, request, **kwargs)
    700 start = preferred_clock()
    702 # Send the request
--> 703 r = adapter.send(request, **kwargs)
    705 # Total elapsed time of the request (approximately)
    706 elapsed = preferred_clock() - start

File ~Desktopprogrammingprojectsrunningauto_tradeenvLibsite-packagesrequestsadapters.py:635, in HTTPAdapter.send(self, request, stream, timeout, verify, cert, proxies)
    633     raise SSLError(e, request=request)
    634 elif isinstance(e, ReadTimeoutError):
--> 635     raise ReadTimeout(e, request=request)
    636 elif isinstance(e, _InvalidHeader):
    637     raise InvalidHeader(e, request=request)

ReadTimeout: HTTPSConnectionPool(host='api.binance.com', port=443): Read timed out. (read timeout=None)

What could be causing this issue? Is it related to the Binance API, or could it be due to the internet blackout? What can I do to resolve this?

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật