Am I misusing socket.setdefaulttimeout here?

Skip Montanaro skip at pobox.com
Thu Mar 20 13:35:10 EST 2003


    [ 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...

Skip





More information about the Python-list mailing list