Am I misusing socket.setdefaulttimeout here?

Dave Brueck dave at pythonapocrypha.com
Thu Mar 20 15:43:52 EST 2003


On Thu, 20 Mar 2003, Skip Montanaro wrote:

>
>     [ traceback when using socket timeouts ]
>
>     Skip>     Traceback (most recent call last):
>     Skip>       File "chksrvrs.py", line 11, in ?
>     Skip>         data = f.read()
>     Skip>       File "/Users/skip/local/lib/python2.3/httplib.py", line 1155, in read
>     Skip>         return s + self._file.read()
>     Skip>     IOError: [Errno 35] Resource temporarily unavailable
>
>     Skip> Do I misunderstand something about socket timeouts or do they not
>     Skip> play well with urllib and friends (I tried both urllib and
>     Skip> urllib2).
>
> Turns out timeouts don't play well with files.  This makes the new socket
> timeout capability pretty worthless with higher level modules based on
> sockets which use line-oriented protocols (httplib, xmlrpclib, etc) which
> always want to deal with files.  Bummer...

Hi Skip,

Can you elaborate on how they don't work right? I'm still using
timeoutsocket.py for some stuff and was hoping to migrate away from that,
but it of course works great with httplib, xmlrpclib, etc.

-Dave





More information about the Python-list mailing list