I'm using requests to make many http requests, and some time, i get timeouts. When i restart the python program, it goes fine. I tried to replicate the "restart the program" with exception handling, but it doesn't works. When i run that :
import requests
session=requests.session()
while 1:
try:
session.get('..url..')
except requests.Timeout:
session=requests.session()
it doesn't do the same thing as restarting the program : i get stucked whith timeout, whereas when i restart the program, i don't get timeouts any more. What can i do ?