simple httplib and urllib timeout question

darrell at darrell at
Tue Apr 11 20:24:56 CEST 2000

"Michal Wallace (sabren)" <sabren at> wrote:
> On Tue, 11 Apr 2000 darrell at wrote:

>> Just a quick question, im writing a small webbot for a python
>> learning experience and it comes across some sites that will make it
>> hang for a while, if the site is down or extremely slow etc, is
>> there a way to set a faster timeout for httplib . Or is there a
>> better way to handle it ?

> Yes. The better way is to use asyncore whenever httplib/urllib uses a
> normal socket. Unfortunately, this requires breaking urllib into
> smaller pieces, and nobody seems to have done it yet. I'm actually
> working on the exact same problem (and posting regular updates
> at ) 

> I sent an email to Jeremy Hylton, who's working on urllib2. He's
> swamped, but willing to accept a patch that would add this feature
> to urllib2.. I think I'll wind up taking a crack at it tonight.

> There's also a partial solution using a different method if you look
> at...

> there's an example script called there, too.. it uses
> and another hack with signal.alarm(), but neither really
> works all that well..

> hope that helps.

> meanwhile... HEY OLEG! -> have you done anything w/ this?

> Cheers,

> - Michal
> -------------------------------------------------------------------------
> -------------------------------------------------------------------------

Thanks Michal , this helps alot :>

More information about the Python-list mailing list