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

Facundo Batista report at bugs.python.org
Sat Mar 22 01:27:26 CET 2008


Facundo Batista <facundo at taniquetil.com.ar> added the comment:

Two or three threads run in parallel at that time for this issue, don't
remember exactly where this was decided.

> *Because* socket.setdefaulttimeout() is a hack for when nothing else is
> available, there should be a way to avoid that global state.

Yes: don't call setdefaulttimeout().


> 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?

The issue is that to allow caller to override the default state you
should pass it None, but None is for default timeout value in the call,
so you should be passing a specific object to mean "override default
timeout", etc... all this is well explained in that thread.

Lot of suggestions were handled, and the final decision was that all
that behaviours will complicate unnecessarily the semantics here (with
the cost of not being able to override the global default).

I suggest you to raise the discussion again in python-dev if you want
this decided behaviour to change.

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


More information about the Python-bugs-list mailing list