From: Victor Stinner Date: Wed, 13 Sep 2017 08:44:08 +0000 (-0700) Subject: bpo-30830: logging.config.listen() calls server_close() (#3524) X-Git-Tag: v3.7.0a1~61 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=97d7e65dfed1d42d40d9bc2f630af56240555f02;p=python bpo-30830: logging.config.listen() calls server_close() (#3524) 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). --- diff --git a/Lib/logging/config.py b/Lib/logging/config.py index c16a75a0f1..b08cba0687 100644 --- a/Lib/logging/config.py +++ b/Lib/logging/config.py @@ -887,7 +887,7 @@ def listen(port=DEFAULT_LOGGING_CONFIG_PORT, verify=None): logging._acquireLock() abort = self.abort logging._releaseLock() - self.socket.close() + self.server_close() class Server(threading.Thread):