Roy Smith <r...@panix.com> added the comment:

The answer depends on what the socket module is trying to do.  Is the goal 
simply to provide a pythonic thin wrapper over the underlying OS interfaces 
without altering their semantics, or to provide a completely homogeneous 
abstraction?  Having attempted the latter before, I'm aware of just how 
difficult a job it can be.

The docs have a big bold note right up top, "Note Some behavior may be platform 
dependent, since calls are made to the operating system socket APIs".  This is 
followed up by, "The platform-specific reference material for the various 
socket-related system calls are also a valuable source of information on the 
details of socket semantics."

What's not clear, however, is the intent.  If the intent is to hide the 
platform differences, then the notes in the docs are simply warnings that we're 
not always successful at doing that.  If so, then exposing the different 
behaviors of listen/accept is a bug which should be fixed.

Anyway, my personal opinion is that we should consider the current behavior a 
bug and fix it.  I like the idea of setting all accepted sockets to blocking 
mode (and documenting it clearly).  I think it is what most people would 
expect.  I understand that this would break code of people who were relying on 
the "accept inherits non-blocking mode" behavior on some OS's, but I suspect 
the number of people who are relying on that behavior is extremely close to 
zero, and they are relying on a non-portable feature of a specific OS.

I leave it to others to figure out which versions it is reasonable to apply 
this to.

----------
nosy: +roysmith

_______________________________________
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

Reply via email to