requests.{get,post} timeout

Skip Montanaro skip.montanaro at gmail.com
Tue Aug 22 16:15:07 EDT 2017


> You could provide both, but since one of them can be handled
> externally (with a thread, with a SIGALRM, or with some other sort of
> time limiting), the other one MUST be provided by the request.

Given the semantics of timeouts which percolate up from the socket
level, I agree with Chris. It has a particular meaning, that
implemented by the underlying socket layer. Unfortunately, the word
"timeout" can take on related (but different) meanings, depending on
context. We can discuss how to implement the timeout which means, "the
maximum amount of time it should take to transfer a chunk of content
from one end of the connection to the other", it's difficult to say
exactly where detecting such timeouts should live in the application's
network stack. That it might be tedious to implement correctly (I
suspect given their druthers, most people would prefer to leave
sleeping threading and signaling dogs lie) is kind of beside the
point.

Now that I have a firmer grasp of what timeout I do have (the socket
level per-read-or-write call timeout), I can decide how important it
is for me to implement the other.

Skip



More information about the Python-list mailing list