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
No way to disable socket timeouts in httplib, etc. #46703
Comments
The new timeout support in 2.6 makes use of new function setdefaultsocket.create_connection() should always call |
When the semantics of timout in htmllib (and the other libraries) were
So, as to enhance practicality and ease to use, when you pass a timeout Regards, |
I see this thread: http://www.gossamer-threads.com/lists/python/dev/552292 But I don't see an explanation of this API decision there that I understand. *Because* socket.setdefaulttimeout() is a hack for when nothing else is You say that "Now that you can pass the timeout when creating the |
Two or three threads run in parallel at that time for this issue, don't
Yes: don't call setdefaulttimeout().
The issue is that to allow caller to override the default state you Lot of suggestions were handled, and the final decision was that all I suggest you to raise the discussion again in python-dev if you want |
The best solution to this problem was pointed out by Josiah Carlson at http://www.gossamer-threads.com/lists/python/dev/555108?do=post_view_threaded#555108 Repeating the proposed solution here sentinel = object()
def create_connection(address, timeout=sentinel):
...
if timeout is not sentinel:
sock.settimeout(timeout)
... Perhaps Fecundo could be persuaded to implement this solution? Alan. |
Mmm.... it seems that not only overlooked this final agreement, but also I'll happily review any proposed patch for this. Alan, maybe you can be |
Great. I'll try to submit a patch this weekend. |
I've attached a patch. My patch introduces one minor issue: it's an inconvenience when wrapping Patch description
Unresolved issues with the new 2.6 timeout functionality
"""This actually only work for HTTP, HTTPS, FTP and FTPS connections.""" That's not true. (What about CacheFTPHandler, for instance?) It's also
|
Should I also have selected "Python 3.0" from the "Versions" list, BTW? |
Me: """ Erm, possibly the meaning and allowed values of the timeout arguments |
Marking just 2.6 is fine. The fix will be merged into 3.0 |
Facundo, are you going to review this? |
Yes! :) |
Commited (part of this) patch on r63788. A lot of small details weren't commited, in a big change like this, the What I have left from this commit, but plan to do it later is a fix to Thank you!! |
Applied the rest of the patch regarding test_urllib2net.py. Thank you! |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: