[Python-checkins] cpython (3.2): Closes #14314: backported fix.

vinay.sajip python-checkins at python.org
Fri Mar 23 15:38:30 CET 2012


http://hg.python.org/cpython/rev/54055646fd1f
changeset: 75904:54055646fd1f
branch: 3.2
parent: 75901:2db4e916245a
user: Vinay Sajip <vinay_sajip at yahoo.co.uk>
date: Fri Mar 23 14:36:22 2012 +0000
summary:
 Closes #14314: backported fix.
files:
 Lib/logging/handlers.py | 3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/Lib/logging/handlers.py b/Lib/logging/handlers.py
--- a/Lib/logging/handlers.py
+++ b/Lib/logging/handlers.py
@@ -857,6 +857,7 @@
 self.toaddrs = toaddrs
 self.subject = subject
 self.secure = secure
+ self._timeout = 5.0
 
 def getSubject(self, record):
 """
@@ -879,7 +880,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,
-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list

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