You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Your patch looks fine but it would be much better with a test in Lib/test/test_smtp.py ;-)
kristjanvalur commented on Jan 13, 2009
kristjanvalurmannequin
MannequinAuthor
More actions
If you can offer a suggestion as to how to reliably trigger a
WSAECONNRESET error on windows (or its equivalent on unix) I'll be
happy to do that.
ggenellina commented on Jan 15, 2009
ggenellinamannequin
Mannequin
More actions
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.
Activity
kristjanvalur commentedon Jan 13, 2009
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.
vstinner commentedon Jan 13, 2009
Your patch looks fine but it would be much better with a test in
Lib/test/test_smtp.py ;-)
kristjanvalur commentedon Jan 13, 2009
If you can offer a suggestion as to how to reliably trigger a
WSAECONNRESET error on windows (or its equivalent on unix) I'll be
happy to do that.
ggenellina commentedon Jan 15, 2009
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.
giampaolo commentedon Jan 15, 2009
IMHO I wouldn't test such case.
Behaviors between different platform are unpredictable.
kristjanvalur commentedon Jan 15, 2009
Submitted as r68618
kristjanvalur commentedon Jan 19, 2009
Note, this has been ported to py3k in http://svn.python.org/view?
view=rev&rev=68736