How to handle timed out connections

Aahz Maruch aahz at netcom.com
Wed Mar 29 09:41:28 EST 2000


[posted & e-mailed]

In article <38CA617C.37948FB9 at rhk.dk>,
Lars Hoeyrup Jensen  <robinhat at rhk.dk> wrote:
>
>I have a program that tries to connect to a certain web page with
>urlopen(). Sometimes the page doesn't respond: if I try to open it in
>Netscape, after a couple of minutes I get a message like this:

There are two separate problems here:

* You need to use try/except to catch errors

* You need an upgrade to httplib to make it timeout automatically when
there's a problem (I've got a patch, but Guido hasn't accepted it yet).
--
                      --- Aahz (Copyright 2000 by aahz at netcom.com)

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

Member of the Groucho Marx Fan Club  --Aahz



More information about the Python-list mailing list