Giampaolo Rodola' <billiej...@users.sourceforge.net> added the comment:
Even if that patch would fix this issue (and I'm pretty sure it does) I don't think it's a good idea handling all those errors (EBADF, ECONNRESET, ENOTCONN, ESHUTDOWN, ECONNABORTED) in readwrite() function. Although those error codes unmistakably remark a disconnect event condition (EBADF too? are we sure it *always* means that?) I would prefer that be done in asyncore.dispatcher() and handle_close() be called from there. That's the implementation asyncore has always used until now where the poller logic (poll(), poll2()) has always been kept separated from the connection logic (asyncore.dispatcher) where the "if socket.err[0] in ..." stuff is done. Unfortunately I haven't got an OS X box to test against and verify by myself, but If I'm not mistaken by looking at the traceback messages pasted by other folks, it seems that the exception takes place in handle_expt_event() at this point: err = self.socket.getsockopt(socket.SOL_SOCKET, socket.SO_ERROR) If that's the case I think it makes more sense catching EBADF from there rather than breaking the logic used so far, also because, if I'm not mistaken, the problem has been introduced by this very line which has been added in Python 2.6. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue5798> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com