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 roysmith
Recipients Justin.Cappos, bbangert, giampaolo.rodola, loewis, ned.deily, nicdumz, ronaldoussoren, roysmith
Date 2010-11-21.13:36:16
SpamBayes Score 6.7784667e-13
Marked as misclassified No
Message-id <1290346579.13.0.134837546765.issue7995@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2010-11-21 13:36:19roysmithsetrecipients: + roysmith, loewis, ronaldoussoren, giampaolo.rodola, ned.deily, nicdumz, bbangert, Justin.Cappos
2010-11-21 13:36:19roysmithsetmessageid: <1290346579.13.0.134837546765.issue7995@psf.upfronthosting.co.za>
2010-11-21 13:36:17roysmithlinkissue7995 messages
2010-11-21 13:36:16roysmithcreate