Newbie question: Why does read() method of urllib hang?

Andrew Ward winelight at spamcop.net
Mon Feb 11 18:58:18 CET 2002


I can't help feeling I'm doing something stupid. Most of the time:

    mystring=u.read()

works fine, but sometimes it just hangs. Is this simply because the remote
server is not responding? I would have thought that would cause
urllib.urlopen() to hang, not u.read().

Or have I made some fundamental mistake in error handling or failing to
clean up, or do I need threads, or...!

Any help greatly appreciated.

Andrew Ward






More information about the Python-list mailing list