[issue1868] threading.local doesn't free attrs when assigning thread exits

Ben Cottrell report at bugs.python.org
Fri Aug 29 00:11:34 CEST 2008


Ben Cottrell <tamino at wolfhut.org> added the comment:

Christian,

Your patch works for me -- thanks!!

I made a slight modification to your patch to allow "del" to work,
and have attached my modified version.

I agree that allowing subclassing makes thread._local harder to get
right than it would otherwise be. There is code out there that uses
that feature, though -- I'm running into it in the context of django,
which (when using the sqlite database back end) keeps its sqlite
connections in a subclass of thread._local.

Added file: http://bugs.python.org/file11298/threading_local3.patch

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


More information about the Python-bugs-list mailing list