summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVinay Sajip <vinay_sajip@yahoo.co.uk>2013-05-16 21:57:02 (GMT)
committerVinay Sajip <vinay_sajip@yahoo.co.uk>2013-05-16 21:57:02 (GMT)
commit862b15e7d0402d3aabe224ca33e45f4e9aa6dd00 (patch)
tree54f0f53324ce7d886a61659b66ef354be33a36b1
parent18b71916531f6b235993aaeaedfb7176b4658aa9 (diff)
downloadcpython-862b15e7d0402d3aabe224ca33e45f4e9aa6dd00.zip
cpython-862b15e7d0402d3aabe224ca33e45f4e9aa6dd00.tar.gz
cpython-862b15e7d0402d3aabe224ca33e45f4e9aa6dd00.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 95e23a8..93aa50e 100644
--- a/Lib/logging/handlers.py
+++ b/Lib/logging/handlers.py
@@ -882,6 +882,7 @@ class SysLogHandler(logging.Handler):
try:
self.socket.send(msg)
except socket.error:
+ self.socket.close()
self._connect_unixsocket(self.address)
self.socket.send(msg)
elif self.socktype == socket.SOCK_DGRAM:
diff --git a/Misc/NEWS b/Misc/NEWS
index d6c151f..251804d 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -21,6 +21,8 @@ Core and Builtins
Library
-------
+- Issue #17981: Closed socket on error in SysLogHandler.
+
- Fix typos in the multiprocessing module.
- Issue #17754: Make ctypes.util.find_library() independent of the locale.