This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author skip.montanaro
Recipients
Date 2003-03-20.18:58:56
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
I've come to the conclusion that, as written, the higher level line-
oriented protocols which use the socket library (httplib, ftplib,
xmlrpclib, etc) won't work with socket timeouts.  They generally do
something like:

    self.file = self.sock.makefile('rb')

then use file methods to send and receive data on the socket.

Alas, the socket docs state:

Timeout mode internally sets the socket in non-blocking mode.
The blocking and timeout modes are shared between file descriptors
and socket objects that refer to the same network endpoint.  A
consequence of this is that file objects returned by the makefile()
method should only be used when the socket is in blocking mode; in
timeout or non-blocking mode file operations that cannot be
completed immediately will fail.  

I view this state of affairs as a bug which should be fixed at some
point, as these higher level protocol modules are probably the 
predominant way sockets get used in Python programs.
History
Date User Action Args
2007-08-23 14:12:01adminlinkissue707074 messages
2007-08-23 14:12:01admincreate