diff --git a/Lib/logging/config.py b/Lib/logging/config.py index 1b0faca..c8a110c 100644 --- a/Lib/logging/config.py +++ b/Lib/logging/config.py @@ -525,5 +525,9 @@ class DictConfigurator(BaseConfigurator): disable_existing = config.pop('disable_existing_loggers', True) logging._handlers.clear() + + # Try to close the handlers before deleting the handler list + logging.shutdown(logging._handlerList[:]) + del logging._handlerList[:] # Do formatters first - they don't refer to anything else