why does socket.makefile require non-blocking mode?

Forest py1.forest at tibit.com
Sat Mar 29 00:50:34 CET 2008

The socket.makefile() docs say, "the socket must be in blocking mode."  I
don't see any explanation of why blocking mode is required, and I'm not sure
whether that means timeout mode is forbidden as well.  Can someone clarify

I wanted to use file-like objects with socket timeouts, so I ended up writing
my own replacement for socket._fileobject.  I'd appreciate it if someone could
either explain to my why my new class was unnecessary, or else encourage me to
contribute it as a patch to the socket module.



More information about the Python-list mailing list