From: Georg Brandl Date: Fri, 11 Aug 2006 07:26:10 +0000 (+0000) Subject: logging's atexit hook now runs even if the rest of the module has X-Git-Tag: v2.5c1~88 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0a7d1bb168e998cd1ddba0f699c6142093e1f530;p=python logging's atexit hook now runs even if the rest of the module has already been cleaned up. --- diff --git a/Lib/logging/__init__.py b/Lib/logging/__init__.py index e8852f3668..dc3400d00d 100644 --- a/Lib/logging/__init__.py +++ b/Lib/logging/__init__.py @@ -1337,14 +1337,14 @@ def disable(level): """ root.manager.disable = level -def shutdown(): +def shutdown(handlerList=_handlerList): """ Perform any cleanup actions in the logging system (e.g. flushing buffers). Should be called at application exit. """ - for h in _handlerList[:]: # was _handlers.keys(): + for h in handlerList[:]: #errors might occur, for example, if files are locked #we just ignore them if raiseExceptions is not set try: diff --git a/Misc/NEWS b/Misc/NEWS index f2fc704688..26047f6ce9 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -38,6 +38,9 @@ Core and builtins Library ------- +- logging's atexit hook now runs even if the rest of the module has + already been cleaned up. + - Bug #1112549, DoS attack on cgi.FieldStorage. - Bug #1531405, format_exception no longer raises an exception if