[Zope-dev] [Checkins] SVN: zope.sendmail/trunk/src/zope/sendmail/mailer.py try again with catching sslerror, thx Jens

Zvezdan Petkovic zvezdan at zope.com
Tue Oct 7 11:00:06 EDT 2008


On Oct 5, 2008, at 4:51 AM, Adam Groszer wrote:

>         connection.sendmail(fromaddr, toaddrs, message)
>         try:
>             connection.quit()
> -        except:
> +        except socket.sslerror:
> +            #something weird happened while quiting
>             pass

This is better because it catches a _specific_ exception.

However, are we _certain_ that the socket is closed after this?

If not, I think we should close it explicitly instead of passing on it.

Thoughts, comments, anybody?



More information about the Zope-Dev mailing list