]> granicus.if.org Git - python/commit
[2.7] bpo-21149: Workaround a GC finalization bug in logging. (#4368)
authorGregory P. Smith <greg@krypto.org>
Sat, 11 Nov 2017 22:48:49 +0000 (14:48 -0800)
committerGitHub <noreply@github.com>
Sat, 11 Nov 2017 22:48:49 +0000 (14:48 -0800)
commite84f6d3817ad3d18fdfbb5223b8078606166cea0
tree355cfdfcec52b1c56f408536c494f9ddd74a4898
parent6401e5671781eb217ee1afb4603cc0d1b0367ae6
[2.7] bpo-21149: Workaround a GC finalization bug in logging. (#4368)

* Work around a GC process finalization bug.

The logging RLock instances may exist but the threading.RLock class
itself has already been emptied causing a
Exception TypeError: "'NoneType' object is not callable" in <function _removeHandlerRef ..."
to be printed to stderr on process termination.

This catches that exception and ignores it because there is absolutely
nothing we can or should do about it from the context of a weakref
handler called from the gc context.
Lib/logging/__init__.py
Misc/NEWS.d/next/Library/2017-11-10-17-19-24.bpo-21149.8UVfeT.rst [new file with mode: 0644]