Issue 4929: smptlib.py can raise socket.error
Created on 2009-01-13 11:31 by kristjan.jonsson, last changed 2022-04-11 14:56 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| smtplib.patch | kristjan.jonsson, 2009-01-13 11:31 | |||
| Messages (7) | |||
|---|---|---|---|
| msg79732 - (view) | 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. |
|||
| msg79765 - (view) | Author: STINNER Victor (vstinner) * ![]() |
Date: 2009-01-13 18:49 | |
Your patch looks fine but it would be much better with a test in Lib/test/test_smtp.py ;-) |
|||
| msg79798 - (view) | Author: Kristján Valur Jónsson (kristjan.jonsson) * ![]() |
Date: 2009-01-13 23:32 | |
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. |
|||
| msg79882 - (view) | Author: Gabriel Genellina (ggenellina) | Date: 2009-01-15 00:35 | |
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. |
|||
| msg79883 - (view) | Author: Giampaolo Rodola' (giampaolo.rodola) * ![]() |
Date: 2009-01-15 00:50 | |
IMHO I wouldn't test such case. Behaviors between different platform are unpredictable. |
|||
| msg79904 - (view) | Author: Kristján Valur Jónsson (kristjan.jonsson) * ![]() |
Date: 2009-01-15 17:28 | |
Submitted as r68618 |
|||
| msg80156 - (view) | Author: Kristján Valur Jónsson (kristjan.jonsson) * ![]() |
Date: 2009-01-19 10:38 | |
Note, this has been ported to py3k in http://svn.python.org/view? view=rev&rev=68736 |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:56:44 | admin | set | github: 49179 |
| 2009-01-19 10:38:31 | kristjan.jonsson | set | keywords:
patch, patch, needs review messages: + msg80156 |
| 2009-01-15 17:28:13 | kristjan.jonsson | set | status: open -> closed keywords: patch, patch, needs review resolution: accepted messages: + msg79904 |
| 2009-01-15 00:50:34 | giampaolo.rodola | set | messages: + msg79883 |
| 2009-01-15 00:35:37 | ggenellina | set | nosy:
+ ggenellina messages: + msg79882 |
| 2009-01-14 11:10:55 | giampaolo.rodola | set | nosy: + giampaolo.rodola |
| 2009-01-13 23:32:22 | kristjan.jonsson | set | keywords:
patch, patch, needs review messages: + msg79798 |
| 2009-01-13 18:49:23 | vstinner | set | keywords:
patch, patch, needs review nosy: + vstinner messages: + msg79765 |
| 2009-01-13 11:31:16 | kristjan.jonsson | create | |
