I wrote a quick test for me to get a better understanding on the python request timeout. My understanding is that the timeout parameter is in seconds thus a timeout of 1 means, if the connection or the read time is more than 1 second an error should be thrown.
import requests
try:
r = requests.get("https://stackoverflow.com/",timeout=0.1)
print(r.elapsed)
except requests.exceptions.Timeout as e:
print(e)
I first ran the script setting the timeout attribute as 1 to get a sense of how long it takes to reading from stackoverflow. My responses were just over 0.1 seconds. So naturally I reduced the timeout to 0.1 expecting an error to occur but instead, I still got the time elapsed printed.The printed time periods are all above 0.1
eg:
0:00:00.117071
0:00:00.118653
0:00:00.120222
What am I missing?