[Python-checkins] cpython (2.7): 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/113b8e3cbba4
changeset: 75903:113b8e3cbba4
branch: 2.7
parent: 75900:0b960e41e533
user: Vinay Sajip <vinay_sajip at yahoo.co.uk>
date: Fri Mar 23 14:33:00 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
@@ -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,
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list