From ba4c777ddad5e53964204f1dbc73d7f7853d3b86 Mon Sep 17 00:00:00 2001 From: stevens Date: Tue, 11 Aug 2026 02:19:26 +0800 Subject: [PATCH] Update logging.config.listen() docstrings to mention dictConfig() (GH-155479) logging.config.listen() docstring had omitted dictConfig() support. (cherry picked from commit 791b5731d0c999d671e5a74a4c6557ddfa2a72a7) Co-authored-by: stevens --- Lib/logging/config.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Lib/logging/config.py b/Lib/logging/config.py index e0524eb5e3d89c2..be53150d12d54ab 100644 --- a/Lib/logging/config.py +++ b/Lib/logging/config.py @@ -952,8 +952,9 @@ def listen(port=DEFAULT_LOGGING_CONFIG_PORT, verify=None): Start up a socket server on the specified port, and listen for new configurations. - These will be sent as a file suitable for processing by fileConfig(). - Returns a Thread object on which you can call start() to start the server, + These will be sent as a file suitable for processing by dictConfig() or + fileConfig(). Returns a Thread object on which you can call start() to + start the server, and which you can join() when appropriate. To stop the server, call stopListening(). @@ -971,8 +972,8 @@ class ConfigStreamHandler(StreamRequestHandler): """ Handler for a logging configuration request. - It expects a completely new logging configuration and uses fileConfig - to install it. + It expects a completely new logging configuration and uses dictConfig + or fileConfig to install it. """ def handle(self): """ @@ -980,7 +981,7 @@ def handle(self): Each request is expected to be a 4-byte length, packed using struct.pack(">L", n), followed by the config file. - Uses fileConfig() to do the grunt work. + Uses dictConfig() or fileConfig() to do the grunt work. """ try: conn = self.connection