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

Fredrik Lundh fredrik at pythonware.com
Sun Feb 17 04:01:01 EST 2002


Andrew Ward wrote:
> It's very intermittent for me. I can leave it running for hours in the
> morning and it's fine, in the evenings (UK time) it usually does fail fairly
> soon.
>
> I'm rewriting the url stuff as individual httplib calls to see if I can pin
> down the exact point of failure, although I assume it will still hang, and
> that it will also be at the read() (I imagine that the urllib read() maps
> directly to the http read() method).

did you get anywhere on this one?

I just realized that a program that has been running
successfully for several years (as a cronjob) recently
started hanging about 99% of the times it's run, after
we upgraded the linux version on that box.

it also hangs when you run it from the command line,
under both 1.5.2 and 2.0.1 -- and when I press control-c,
I find that it's stuck on this line:

    oldcontent = file.read()

where "file" is an urllib stream.

and to confuse things even more, if I fire up an inter-
preter and types in the correspond urllib calls, it never
ever hangs.

bug in linux?

</F>





More information about the Python-list mailing list