From: Vinay Sajip Date: Thu, 16 May 2013 21:47:47 +0000 (+0100) Subject: Issue #17981: Closed socket on error in SysLogHandler. X-Git-Tag: v2.7.6rc1~388 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=bb6b51ca2543967d0cbc5398500eee5a0826b3ea;p=thirdparty%2FPython%2Fcpython.git Issue #17981: Closed socket on error in SysLogHandler. --- diff --git a/Lib/logging/handlers.py b/Lib/logging/handlers.py index 5837f4eda359..c4b8746ee5a9 100644 --- a/Lib/logging/handlers.py +++ b/Lib/logging/handlers.py @@ -856,6 +856,7 @@ class SysLogHandler(logging.Handler): 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 index c8dc24b11d87..394b08b086bd 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -12,6 +12,8 @@ Core and Builtins 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.