[Zope] i want a timeout interrupt

Júlio Dinis Silva juliodinis@hotmail.com
Thu, 29 Nov 2001 10:29:04 +0000


>From: "Horst Wald" <horstwald@hotmail.com>
>To: zope@zope.org, website-talk-admin@list.ora.com
>Subject: [Zope] i want a timeout interrupt
>Date: Wed, 28 Nov 2001 14:51:30 +0000
>
>Hi,
>
>can one interrupt the execution of a script when a certain amount of time
>has passed?
>
>What I want to do:
>- I start with a given URL.
>- Then I read the webpage denoted by it into a string like
>page=urllib.urlopen(URL).read() and if it satisfies a given condition 
>(e.g.,
>it contains a certain word), parse it to find out all the urls it contains.
>- With these new urls I continue
>- I take care not to read the same URL twice
>
>This works fine in general, but there are certain web pages that never
>respond. If you try view them with a browser you get a timeout after a few
>mintues. But the urllib.urlopen() script keeps waiting until it gets a
>response and if never gets one, the whole program is stopped. What I would
>like now is to interrupt the script an return '' if it gets no response
>after 10secs.

http://lists.zope.org/pipermail/zope/2001-May/089731.html

Regards,
Julio Dinis Silva

_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp