blocking forever with urllib

Michael P. Soulier msoulier at storm.ca
Fri Aug 31 17:51:06 EDT 2001


On 30 Aug 2001 21:56:35 -0700, Naris Siamwalla <naris at ensim.com> wrote:
> i ran into this problem when some web servers will accept
> the connection but just wait and do nothing.  to fix this we
> added a select in httplib's (py 1.5.x) getreply:
>         import select
>         (r,w,e) = select.select([self.sock],[],[],30.0)
>         if r:
>             line = self.file.readline()
>         else:
>             raise socket.error, "select timeout"
> don't know how correct this is, but it worked for us.

    Great, thanks. 

    Mike

-- 
Michael P. Soulier <michael.soulier at home.com>, GnuPG pub key: 5BC8BE08
"Pretty soon, massive bloat is the industry standard and everyone is using
huge, buggy programs not even their developers can love."
    -Eric S. Raymond, The Art of Unix Programming



More information about the Python-list mailing list