From: Vinay Sajip Date: Fri, 23 Mar 2012 14:36:22 +0000 (+0000) Subject: Closes #14314: backported fix. X-Git-Tag: v3.3.0a2~51^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ee64b28cf44c14bfa4f7626357b8d99d2110e404;p=thirdparty%2FPython%2Fcpython.git Closes #14314: backported fix. --- diff --git a/Lib/logging/handlers.py b/Lib/logging/handlers.py index 73ce031545d9..fed8c9393d61 100644 --- a/Lib/logging/handlers.py +++ b/Lib/logging/handlers.py @@ -857,6 +857,7 @@ class SMTPHandler(logging.Handler): self.toaddrs = toaddrs self.subject = subject self.secure = secure + self._timeout = 5.0 def getSubject(self, record): """ @@ -879,7 +880,7 @@ class SMTPHandler(logging.Handler): port = self.mailport if not port: port = smtplib.SMTP_PORT - smtp = smtplib.SMTP(self.mailhost, port) + smtp = smtplib.SMTP(self.mailhost, port, timeout=self._timeout) msg = self.format(record) msg = "From: %s\r\nTo: %s\r\nSubject: %s\r\nDate: %s\r\n\r\n%s" % ( self.fromaddr,