[issue2451] No way to disable socket timeouts in httplib, etc.

John J Lee report at bugs.python.org
Sat Mar 22 01:00:18 CET 2008


John J Lee <jjlee at users.sourceforge.net> added the comment:

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
available, there should be a way to avoid that global state.

You say that "Now that you can pass the timeout when creating the
connection, you shouldn't use the default setting.".  That's true, for
new code, and for code is able to immediately change -- indeed, that
always has been true.  Code exists that makes use of
socket.setdefaulttimeout(), or requires use of it in order to set a
timeout.  Can you explain why this state of affairs makes it necessary
to force this global state on users of httplib?

__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue2451>
__________________________________


More information about the Python-bugs-list mailing list