Author: Kristján Valur Jónsson (kristjan.jonsson) *
Date: 2009-01-13 11:31
the SMPT.getreply() method doesn't check for socket.error when doing its readline() call. We now check for connection reset and others that can occur here and properly close. This is to comply with the documentation that doesn't specify socket.error as part of the exceptions raised.
On Windows, if you exit a process abnormally (using e.g. os._exit() in Python) while it still has open connections, the other side receives a WSAECONNRESET (error 10054). So, you could write a test case using a dumb server (running as another process) with a very short, predefined sequence of recv/send calls, ending abruptly with os._exit(). On Linux I *think* you would get ECONNRESET, and at least some form of error on other OS's.