Patch: httplib.py default timeout

Aahz Maruch aahz at netcom.com
Wed Dec 22 12:10:09 EST 1999


No, I'm not including the actual patch here.  I just wanted to see if
anyone had an objection to changing httplib.py so that by default it
times out after sixty seconds.  To maintain the current behavior, you'd
have to pass in a parameter of 'timeout=0'.

The background is that we've been (okay, foolishly) trying to use urllib
in a production environment.  We've also been using httplib directly
when urllib's behavior is inappropriate.  In both cases we've been
having hangs in our programs; we fixed the latter problem by
manipulating HTTP.socket directly.  That's not an option for urllib, and
we'd rather not dump urllib because we've already put in a fair amount
of time subclassing urllib to fix its behavior.  Jeremy's urllib2 isn't
the answer, either, because it doesn't address the timeout problem.

I don't think subclassing HTTP would help.  ;-)

I've got a patch more-or-less ready to go to Guido; I'll probably send
it next week after we've tested it a bit more thoroughly.
--
                      --- Aahz (@netcom.com)

Androgynous poly kinky vanilla queer het    <*>     http://www.rahul.net/aahz/
Hugs and backrubs -- I break Rule 6

TEOTWAWKI -- 10 days and counting!



More information about the Python-list mailing list