From 476ce2b4776df432f9e2fd62efac5395d5a8fb02 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Wed, 13 Sep 2017 03:09:03 +0200 Subject: [PATCH] bpo-30830: logging.config.listen() calls server_close() The ConfigSocketReceiver.serve_until_stopped() method from logging.config.listen() now calls server_close() (of socketserver.ThreadingTCPServer) rather than closing manually the socket. While this change has no effect yet, it will help to prevent dangling threads once ThreadingTCPServer.server_close() will join spawned threads (bpo-31233). --- Lib/logging/config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/logging/config.py b/Lib/logging/config.py index c16a75a0f1edfa4..b08cba0687563d6 100644 --- a/Lib/logging/config.py +++ b/Lib/logging/config.py @@ -887,7 +887,7 @@ def serve_until_stopped(self): logging._acquireLock() abort = self.abort logging._releaseLock() - self.socket.close() + self.server_close() class Server(threading.Thread):