[Python-Dev] Adding timeout option to httplib...connect()

Guido van Rossum guido at python.org
Sat Feb 10 20:42:55 CET 2007


On 2/10/07, skip at pobox.com <skip at pobox.com> wrote:
> Guido, I looked at urllib2 and quickly gave up.  I have no idea how that
> code works (where is a lower level library's connection object instantiated,
> for example?).  I presume with timeouts in the lower level libraries someone
> who knows how urllib2 works will be able to graft timeouts onto it without
> too much work.

Thanks for looking anyway! I had a quick look myself; I think it
relies on the implicit call to connect() in the HTTPConnection class's
request() method. This answers my question: the timeout should be
passed to the HTTPConnection constructor which stores it in an
instance variable just like host and port, and then connect() will get
it from there.

-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)


More information about the Python-Dev mailing list