[Python-checkins] bpo-30830: logging.config.listen() calls server_close() (#3524)

Victor Stinner webhook-mailer at python.org
Wed Sep 13 04:44:14 EDT 2017


https://github.com/python/cpython/commit/97d7e65dfed1d42d40d9bc2f630af56240555f02
commit: 97d7e65dfed1d42d40d9bc2f630af56240555f02
branch: master
author: Victor Stinner <victor.stinner at gmail.com>
committer: GitHub <noreply at github.com>
date: 2017-09-13T01:44:08-07:00
summary:

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).

files:
M Lib/logging/config.py

diff --git a/Lib/logging/config.py b/Lib/logging/config.py
index c16a75a0f1e..b08cba06875 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):
 



More information about the Python-checkins mailing list