[Python-checkins] cpython (2.7): Issue #17981: Closed socket on error in SysLogHandler.

vinay.sajip python-checkins at python.org
Fri May 17 00:03:13 CEST 2013


http://hg.python.org/cpython/rev/d91da96a55bf
changeset:   83797:d91da96a55bf
branch:      2.7
parent:      83786:cd577c328886
user:        Vinay Sajip <vinay_sajip at yahoo.co.uk>
date:        Thu May 16 22:47:47 2013 +0100
summary:
  Issue #17981: Closed socket on error in SysLogHandler.

files:
  Lib/logging/handlers.py |  1 +
  Misc/NEWS               |  2 ++
  2 files changed, 3 insertions(+), 0 deletions(-)


diff --git a/Lib/logging/handlers.py b/Lib/logging/handlers.py
--- a/Lib/logging/handlers.py
+++ b/Lib/logging/handlers.py
@@ -856,6 +856,7 @@
                 try:
                     self.socket.send(msg)
                 except socket.error:
+                    self.socket.close() # See issue 17981
                     self._connect_unixsocket(self.address)
                     self.socket.send(msg)
             elif self.socktype == socket.SOCK_DGRAM:
diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -12,6 +12,8 @@
 Library
 -------
 
+- Issue #17981: Closed socket on error in SysLogHandler.
+
 - Issue #17754: Make ctypes.util.find_library() independent of the locale.
 
 - Fix typos in the multiprocessing module.

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list