changeset: 75903:113b8e3cbba4 branch: 2.7 parent: 75900:0b960e41e533 user: Vinay Sajip date: Fri Mar 23 14:33:00 2012 +0000 files: Lib/logging/handlers.py description: Closes #14314: backported fix. diff -r 0b960e41e533 -r 113b8e3cbba4 Lib/logging/handlers.py --- a/Lib/logging/handlers.py Fri Mar 23 15:04:27 2012 +0100 +++ b/Lib/logging/handlers.py Fri Mar 23 14:33:00 2012 +0000 @@ -868,6 +868,7 @@ self.toaddrs = toaddrs self.subject = subject self.secure = secure + self._timeout = 5.0 def getSubject(self, record): """ @@ -890,7 +891,7 @@ 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,

AltStyle によって変換されたページ (->オリジナル) /