From f34e396b18ebbfb5415f0d20b4d5b63374f48cca Mon Sep 17 00:00:00 2001 From: Mark Dickinson Date: Wed, 4 Aug 2010 14:42:13 +0000 Subject: [PATCH] Issue #5798: Handle select.poll flag oddities properly on OS X. This fixes test_asynchat and test_smtplib failures on OS X. (Backport of r73182 from trunk.) --- Lib/asyncore.py | 10 ++++++++-- Misc/NEWS | 12 ++++++++++++ 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/Lib/asyncore.py b/Lib/asyncore.py index 16fe43a237..8b9ba8795a 100644 --- a/Lib/asyncore.py +++ b/Lib/asyncore.py @@ -103,10 +103,16 @@ def readwrite(obj, flags): obj.handle_read_event() if flags & select.POLLOUT: obj.handle_write_event() - if flags & (select.POLLHUP | select.POLLERR | select.POLLNVAL): - obj.handle_close() if flags & select.POLLPRI: obj.handle_expt_event() + if flags & (select.POLLHUP | select.POLLERR | select.POLLNVAL): + obj.handle_close() + except socket.error, e: + if e.args[0] not in (EBADF, ECONNRESET, ENOTCONN, ESHUTDOWN, +ECONNABORTED): + obj.handle_error() + else: + obj.handle_close() except _reraised_exceptions: raise except: diff --git a/Misc/NEWS b/Misc/NEWS index d6ac5a862b..7c774c75e4 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -4,6 +4,18 @@ Python News (editors: check NEWS.help for information about editing NEWS using ReST.) +What's New in Python 2.6.6? +=========================== + +*Release date: XXXX-XX-XX* + +Library +------- + +- Issue #5798: Handle select.poll flag oddities properly on OS X. + This fixes test_asynchat and test_smtplib failures on OS X. + + What's New in Python 2.6.6 rc 1? ================================ -- 2.40.0