Catch socket errors when closing SMTP connections.

This commit is contained in:
Bastian Kleineidam 2010-11-26 19:51:26 +01:00
parent 96de427112
commit c5676f0297
2 changed files with 6 additions and 1 deletions

View file

@ -8,6 +8,8 @@ Fixes:
- gui: Fix sorting of columns in URL result list.
- checking: Fix wrong __init__ call to URL proxy handler.
Closes: SF bug #3118254
- checking: Catch socket errors (for example socket.timeout)
when closing SMTP connections.
Changes:
- dependencies: Require and use Python 2.6.

View file

@ -22,6 +22,7 @@ import re
import urllib
import urlparse
import smtplib
import socket
from email._parseaddr import AddressList
import sys
@ -357,10 +358,12 @@ class MailtoUrl (urlbase.UrlBase):
return
connection = self.url_connection
self.url_connection = None
raise
try:
connection.quit()
except smtplib.SMTPException:
except (smtplib.SMTPException, socket.error):
# ignore close errors
# socket.error is raised for example on timeouts
pass
def set_cache_keys (self):