how to handle network failures

Lawrence D'Oliveiro ldo at geek-central.gen.new_zealand
Sun Oct 10 00:52:24 EDT 2010


In message <m2lj67af14.fsf at web.de>, Diez B. Roggisch wrote:

> for n in xrange(max_number_of_retries):
>     try:
>         f=urllib.urlopen(self.url)
>         data = f.read()
>         break # exist the loop if all
>     except IOError:
>         pass

Is it worth delaying before retrying? In case of a transient routing error, 
that kind of thing.



More information about the Python-list mailing list