requests.{get,post} timeout

Jon Ribbens jon+usenet at unequivocal.eu
Tue Aug 22 12:58:10 EDT 2017


On 2017-08-22, Skip Montanaro <skip.montanaro at gmail.com> wrote:
> I'm using the requests module with timeouts to fetch URLs, for example:
>
>     response = requests.get("http://www.google.com/", timeout=10)
>
> I understand the timeout value in this case applies both to creating the
> connection and fetching the remote content. Can the server dribble out the
> content (say, one byte every few seconds) to avoid triggering the timeout,

Yes. There is no timeout feature that can be used to limit the total
time a 'requests' request takes. Some people might think that this is
a serious flaw in the requests library that would need urgent
rectification in order to make the library safe and useful to use in
almost any situation, but the 'requests' developers are apparently not
among those people.



More information about the Python-list mailing list