The-Weather-TEAM / Life-SCORE

Evaluation personnalisée d'une ville française choisie par rapport à l'utilisateur
GNU General Public License v3.0
8 stars 2 forks source link

Bug si connexion trop lente #57

Closed bosy0 closed 1 year ago

bosy0 commented 1 year ago

PowerShell 7.3.1 PS C:\Users\natha\Documents\GitHub\Weather-NSI> & C:/Users/natha/AppData/Local/Programs/Python/Python311/python.exe c:/User s/natha/Documents/GitHub/Weather-NSI/code/LifeSCORE.py Traceback (most recent call last): File "C:\Users\natha\AppData\Local\Programs\Python\Python311\Lib\site-packages\urllib3\connectionpool.py", line 386, in _ make_request self._validate_conn(conn) File "C:\Users\natha\AppData\Local\Programs\Python\Python311\Lib\site-packages\urllib3\connectionpool.py", line 1042, in _validate_conn conn.connect() File "C:\Users\natha\AppData\Local\Programs\Python\Python311\Lib\site-packages\urllib3\connection.py", line 414, in conne ct self.sock = ssl_wrapsocket( ^^^^^^^^^^^^^^^^ File "C:\Users\natha\AppData\Local\Programs\Python\Python311\Lib\site-packages\urllib3\util\ssl.py", line 449, in ssl_wr ap_socket ssl_sock = _ssl_wrap_socketimpl( ^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\natha\AppData\Local\Programs\Python\Python311\Lib\site-packages\urllib3\util\ssl.py", line 493, in _ssl_w rap_socket_impl return ssl_context.wrap_socket(sock, server_hostname=server_hostname) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\natha\AppData\Local\Programs\Python\Python311\Lib\ssl.py", line 517, in wrap_socket return self.sslsocket_class._create( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\natha\AppData\Local\Programs\Python\Python311\Lib\ssl.py", line 1075, in _create self.do_handshake() File "C:\Users\natha\AppData\Local\Programs\Python\Python311\Lib\ssl.py", line 1346, in do_handshake self._sslobj.do_handshake() TimeoutError: _ssl.c:975: The handshake operation timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Users\natha\AppData\Local\Programs\Python\Python311\Lib\site-packages\requests\adapters.py", line 489, in send resp = conn.urlopen( ^^^^^^^^^^^^^ File "C:\Users\natha\AppData\Local\Programs\Python\Python311\Lib\site-packages\urllib3\connectionpool.py", line 787, in u rlopen retries = retries.increment( ^^^^^^^^^^^^^^^^^^ File "C:\Users\natha\AppData\Local\Programs\Python\Python311\Lib\site-packages\urllib3\util\retry.py", line 550, in incre ment raise six.reraise(type(error), error, _stacktrace) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\natha\AppData\Local\Programs\Python\Python311\Lib\site-packages\urllib3\packages\six.py", line 770, in rer aise raise value File "C:\Users\natha\AppData\Local\Programs\Python\Python311\Lib\site-packages\urllib3\connectionpool.py", line 703, in u rlopen httplib_response = self._makerequest( ^^^^^^^^^^^^^^^^^^^ File "C:\Users\natha\AppData\Local\Programs\Python\Python311\Lib\site-packages\urllib3\connectionpool.py", line 389, in make_request self._raise_timeout(err=e, url=url, timeoutvalue=conn.timeout) File "C:\Users\natha\AppData\Local\Programs\Python\Python311\Lib\site-packages\urllib3\connectionpool.py", line 340, in raise_timeout raise ReadTimeoutError( urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='www.data.gouv.fr', port=443): Read timed out. (read timeout= 5)

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "c:\Users\natha\Documents\GitHub\Weather-NSI\code\LifeSCORE.py", line 50, in erreur_maj = update.executer() ^^^^^^^^^^^^^^^^^ File "c:\Users\natha\Documents\GitHub\Weather-NSI\code\update.py", line 84, in executer test_connexion = connexion('https://www.data.gouv.fr') ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "c:\Users\natha\Documents\GitHub\Weather-NSI\code\classes.py", line 87, in is_connected requests.get(url, timeout=5) File "C:\Users\natha\AppData\Local\Programs\Python\Python311\Lib\site-packages\requests\api.py", line 73, in get return request("get", url, params=params, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\natha\AppData\Local\Programs\Python\Python311\Lib\site-packages\requests\api.py", line 59, in request return session.request(method=method, url=url, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\natha\AppData\Local\Programs\Python\Python311\Lib\site-packages\requests\sessions.py", line 587, in reques t resp = self.send(prep, send_kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\natha\AppData\Local\Programs\Python\Python311\Lib\site-packages\requests\sessions.py", line 701, in send r = adapter.send(request, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\natha\AppData\Local\Programs\Python\Python311\Lib\site-packages\requests\adapters.py", line 578, in send raise ReadTimeout(e, request=request) requests.exceptions.ReadTimeout: HTTPSConnectionPool(host='www.data.gouv.fr', port=443): Read timed out. (read timeout=5)

Farenc21 commented 1 year ago

Peut être deux choses a dire :

bosy0 commented 1 year ago

si je vais faire ça je sais comment le régler, c'est juste à la médiathèque avec mon partage de co c'était horrible rien ne marchait mdr je vais aussi rajouter la condition avec try si ça met trop de temps