hang in urllib.read()?

Joonas Paalasmaa joonas at olen.to
Mon Mar 25 03:18:52 EST 2002


Nick Arnett wrote:
> 
> The (presumably) infinite loop that I thought was in sgmllib, about which I
> posted earlier, actually seems to be when I call read() on an urllib.urlopen
> object.  It's terribly non-reproducible, though -- I'm retrieving lots of
> pages and sometimes it'll go for dozens and dozens, no problem.  Other time
> it hangs after just a few.  And it won't do it on the same page twice, as
> far as I can see.
> 
> I've been unable to find anything like this searching...  sound familiar to
> anyone, or any suggestions for nailing it down, short of gruesome stepping
> through with a debugger, hoping I can catch one...?
> 
> This is on Win2000 with Python 2.2.  Haven't tried on other platforms yet.

Your problem is propably the quite long timeout of urlopen. 
Search Google Groups for "urllib timeout" or take a look at
http://www.timo-tasi.org/python/timeoutsocket.py



More information about the Python-list mailing list