summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 bed09f0..f1ddbb5 100644
--- a/Lib/logging/handlers.py
+++ b/Lib/logging/handlers.py
@@ -876,6 +876,7 @@ class SysLogHandler(logging.Handler):
try:
self.socket.send(msg)
except OSError:
+ 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 ceab576..953d57e 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -91,6 +91,8 @@ Core and Builtins
Library
-------
+- Issue #17981: Closed socket on error in SysLogHandler.
+
- Issue #17964: Fix os.sysconf(): the return type of the C sysconf() function
is long, not int.