On Tue, 26 Jul 2011 19:32:56 -0400 Glyph Lefkowitz <gl...@twistedmatrix.com> wrote: > > On Jul 26, 2011, at 6:49 PM, Antoine Pitrou wrote: > > > On Mon, 25 Jul 2011 15:28:47 +1000 > > Nick Coghlan <ncogh...@gmail.com> wrote: > >> There may be some error codes that we choose to map to these generic > >> errors, even if we don't give them their own exception types at this > >> point (e.g. ECONSHUTDOWN could map directly to ConnectionError). > > > > Ok, I can find neither ECONSHUTDOWN nor ECONNSHUTDOWN on > > www.opengroup.org, and it's not mentioned in errnomodule.c. Is it some > > system-specific error code? > > I assume that ESHUTDOWN is the errno in question? (This is also already > mentioned in the PEP.)
Indeed, I mentioned it in the PEP, as it appears in asyncore.py. But I can't find it on www.opengroup.org, and no man page on my Linux system (except the "errno" man page) seems to mention it. The description from errnomodule.c says "Cannot send after transport endpoint shutdown", but send() actually returns EPIPE, not ESHUTDOWN, when the socket has been shutdown: >>> conn = socket.create_connection(("www.python.org", 80)) >>> conn.shutdown(socket.SHUT_WR) >>> conn.send(b"xxx") Traceback (most recent call last): File "<stdin>", line 1, in <module> socket.error: [Errno 32] Broken pipe >From the send() man page: EPIPE The local end has been shut down on a connection oriented socket. In this case the process will also receive a SIGPIPE unless MSG_NOSIGNAL is set. Regards Antoine. _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com