Closed schwma closed 2 years ago
This (the request library having default infinite timeout) has bitten me in some other settings as well. I think that infinite timeout is not a good idea, particularly for web requests. Maybe the default ought to be something sufficiently high (i.e. 600 seconds) rather than None?
I agree, a default timeout value would be useful and is what I, as a developer using the caldav
library, would expect. It seems as though there even is a discussion about eventually adding a default timeout value to requests
itself.
Good - though the details are in the blue, it seems to me that there is some kind of consensus that at some point in the future, the requests library will have some kind of default timeout set. Though, in that case the default should not be None
, the default should be to not pass the parameter (and let the requests libary set the default).
I run
caldav
requests every 15 minutes in an endless loop and eventually my program will freeze indefinitely. This is because by default therequests
library uses atimeout
value ofNone
which equates to an infinite timeout value. This PR allows developers to instantiateDAVClient
with an optionaltimeout
value that is passed on to therequest
method call.