-
-
Notifications
You must be signed in to change notification settings - Fork 9.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ConnectionError on timeout=0 #1615
Comments
Thanks for raising this issue! I don't think I agree with your assessment of what the 'expected behaviour' of this should be. You've set a timeout of zero seconds. That implies that the connection process should time out after zero seconds, e.g. immediately. I'm a bit mixed here. On the one hand, we're doing exactly what the code asked for. On the other hand, I'd argue that falsy values for timeout should be treated the same as |
If it times out immediately, then it should raise an |
Unfortunately the problem here is in |
@Lukasa they are thoroughly distinct values in this context. I would be okay with seeing While I don't think we're doing anything wrong by passing this along and catching (and raising) the right exception, I think @Damgaard is justified in his confusion. Regardless, I'm not entirely convinced this justifies a change. Perhaps the documentation could be improved, but if we do change this it will be a breaking API change and will have to be put off until 2.0. There are probably plenty of people properly handling this and changing the exception raised would break their code. |
Mm, maybe specialcasing |
In all candor I'm of the opinion that we already special case too many things in requests. A fair number of them are untested and that means that they can regress at any time. |
Related urllib3/urllib3/pull/246 |
Good spot @piotr-dobrogost, that should solve our problems nicely. |
I get the following exception when doing a request with
timeout=0
.I don't see any mention of this in the issues. Shouldn't the expected behavior of this be equivalent to
timeout=None
?I'm running
requests
version 1.2.3 and python 2.7.3The text was updated successfully, but these errors were encountered: