New submission from Martin <gzl...@googlemail.com>:

With the logging change to using weakrefs for handler cleanup done by the 
follow-on patch in issue 6615 exceptions may now be thrown during module 
teardown.

There are two distinct problem cases:
1) The new `_removeHandlerRef` function may run during teardown (when module 
globals are being set to None) but uses the module globals `_acquireLock`, 
`_releaseLock`, and `_handlerList`.
2) The `Handler.close` method no longer removes the instance from the module 
global list, this means if the caller then closes the underlying file but keeps 
a reference to the handler, the `shutdown` function will attempt to flush the 
already-closed file.

It may be that this new way of doing things is preferred and the response to 
closing underlying files or holding on to handler references is Don't Do That 
Then, but this seems like an accidental regression.

----------
components: Library (Lib)
messages: 112713
nosy: flox, gz, vinay.sajip
priority: normal
severity: normal
status: open
title: Logging shutdown regressions with weakrefs
type: behavior
versions: Python 2.7, Python 3.2, Python 3.3

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue9501>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to