Can't close SMTP connection, when already disconnected.
|Reported by:||sebastian_noack||Owned by:||nobody|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
When the server has closed the SMTP connection (that happens rather quickly with most SMTP servers if you don't send any command for a few seconds), the exception SMTPServerDisconnected will be raised when trying to use the connection. That also happens when calling .quit(), like the SMTP backend does in its close() method.
So I have written a patch that catches SMTPServerDisconnected in addition to socket.sslerror, while closing the SMTP connection.
Change History (6)
Changed 3 years ago by sebastian_noack
comment:1 Changed 3 years ago by claudep
- Needs documentation unset
- Needs tests set
- Patch needs improvement unset
- Triage Stage changed from Unreviewed to Accepted
- Type changed from Uncategorized to Cleanup/optimization
Changed 3 years ago by hongshuning
comment:3 Changed 3 years ago by hongshuning
- Cc hongshuning@… added
- Easy pickings set
- Needs tests unset