[Python-Dev] socket timeouts and httplib
Skip Montanaro
skip@pobox.com
Fri, 27 Jun 2003 15:18:07 -0500
Jeremy> I ask because some simple httplib tests aren't working as
Jeremy> expected with timeouts turned on. I'm also curious because the
Jeremy> socket documentation says you shouldn't mix timeouts and
Jeremy> makefile(), and httplib uses makefile().
In theory, the change I made to socket.py a couple months ago to always use
its _socketobject (and thus _fileobject) class should allow timeouts to be
used with makefile. I'd like to know if (and why) you're apparently not
getting that code.
Jeremy> When I do have a small timeout and a slow server, I sometimes see an
Jeremy> error like this:
...
Jeremy> self.connect()
Jeremy> File "/home/jeremy/src/python/dist/src/Lib/httplib.py", line 546, in connect
Jeremy> raise socket.error, msg
Jeremy> IOError: [Errno socket error] (114, 'Operation already in progress')
Do you perhaps need to cvs up? (Or have you modified your copy of
httplib.py?) I'm cvs up'd and line 546 is the "def close" line two lines
after the above raise statement.
Skip