Justin Cappos <justincap...@gmail.com> added the comment: >> This implementation assumes that the OS sets any socket it receives >> via accept to nonblocking. (this is a false assumption on BSD) > > Not true. It doesn't assume that (it doesn't assume the reverse, > either).
The Python implementation sets timeout=None (which implies that the underlying socket is blocking). >> The end result is that the OS has a nonblocking socket and the Python >> object thinks it is blocking. This is why the socket object in >> Python has timeout=None yet calling fcntl shows the socket is >> nonblocking. > > That conclusion is flawed. Python has not associated a timeout with > the socket. It makes no claims as to whether the socket is blocking > or not. So you have created a non-blocking socket without timeout. The problem is that it has. It has created a new Python socket object with a specific value for timeout (None), but the underlying socket is nonblocking. The docs state that timeout = None makes the socket blocking. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue7995> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com