[issue9501] Logging shutdown regressions with weakrefs

Xavier de Gaye report at bugs.python.org
Wed Jan 16 00:08:31 CET 2013


Xavier de Gaye added the comment:

The reason why this happens in python 3.3.0 and not in 3.2:

1) lastResort holds a reference to an instance of _StderrHandler at
   module tear down, thus potentially triggering a TypeError in
   _removeHandlerRef.

2) The logging code has the following two lines that are meant to
   avoid the occurence of this problem:

    _defaultLastResort = _StderrHandler(WARNING)
    lastResort = _defaultLastResort

Issue 12637 describes another unrelated problem with lastResort in
python 3.2. As a workaround to this issue 12637, my application sets
lastResort to None and this works fine in 3.2 (the logging howto
states 'To obtain the pre-3.2 behaviour, logging.lastResort can be set
to None').  With python 3.3 it is this setting of lastResort to None
that causes these spurious 'exception ignored' messages, after
removing this setting no messages are printed anymore.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue9501>
_______________________________________


More information about the Python-bugs-list mailing list