summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVinay Sajip <vinay_sajip@yahoo.co.uk>2013-05-16 21:47:47 (GMT)
committerVinay Sajip <vinay_sajip@yahoo.co.uk>2013-05-16 21:47:47 (GMT)
commitbb6b51ca2543967d0cbc5398500eee5a0826b3ea (patch)
treeb25c47c4f33c797ed4f9624561eae65c44240136
parent6166709eec557f52075417b19676dccc9f405fda (diff)
downloadcpython-bb6b51ca2543967d0cbc5398500eee5a0826b3ea.zip
cpython-bb6b51ca2543967d0cbc5398500eee5a0826b3ea.tar.gz
cpython-bb6b51ca2543967d0cbc5398500eee5a0826b3ea.tar.bz2
Issue #17981: Closed socket on error in SysLogHandler.
-rw-r--r--Lib/logging/handlers.py1
-rw-r--r--Misc/NEWS2
2 files changed, 3 insertions, 0 deletions
diff --git a/Lib/logging/handlers.py b/Lib/logging/handlers.py
index 5837f4e..c4b8746 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 c8dc24b..394b08b 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.