FAQ
Hello!
On Mon, 26 Apr 1999, Kevin L wrote:
I'm trying to use urllib.urlopen() on a big list of urls, some of which are
dead (they don't return a 404, just no response). And the function just waits.
Is there any way to specify a timeout period for this function? thanks,
this is well-known problem with sockets. No, there is no simple way to
specify timeout. You should rewrite your program to use either fork() or
threads.
One thread (or parent process, if you use fork()) controlls another, and
after timeout kill watching thread/process. Recently I rewrote my URL
checker to use fork() (the very checker is under debuggung and soon to be
published).
Kevin
Oleg.
----
Oleg Broytmann National Research Surgery Centre http://sun.med.ru/~phd/
Programmers don't die, they just GOSUB without RETURN.

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 2 of 5 | next ›
Discussion Overview
grouppython-list @
categoriespython
postedApr 26, '99 at 4:48a
activeApr 26, '99 at 12:18p
posts5
users4
websitepython.org

People

Translate

site design / logo © 2021 Grokbase