[Python-Dev] Fixing send()

Guido van Rossum guido@python.org
Thu, 25 Oct 2001 14:03:13 -0400


> If we're making the std library routines that use sockets robust, I
> expect we ought to think about exceptions that should be dealt with.
> My Linux man page suggests that ENOBUFS and EINTR are errors that
> indicate "try again."  There are probably other such errors on other
> platforms. 
> 
> We use Python sockets and asyncore in ZEO (a Zope subsystem) and I've
> found that every weird error that I've never heard of seems to occur
> in the wild.  If we don't deal with these errors, then we've haven't
> fully succeeded in making the calls robust.

There's a difference though.  The bug I'm trying to fix with sendall()
was a silent failure, causing at best protocol failures later, at
worst silently lost data.  ENOBUFS or EINTR etc. cause clear
exceptions when they happen.

--Guido van Rossum (home page: http://www.python.org/~guido/)