[issue3710] Reference leak in thread._local

2010-08-21 Thread Ben Cottrell
Ben Cottrell added the comment: The latest patch over in #1868 is working fine for my company in production, and solves #3710 as well. I think the only thing left to do on that patch is to make it special case "__dict__". -- ___ Pyth

[issue3710] Reference leak in thread._local

2008-08-27 Thread Ben Cottrell
New submission from Ben Cottrell <[EMAIL PROTECTED]>: This is a copy of a message I sent to the python-dev mailing list; it was suggested in a reply that I file a bug for this issue. I'm filing it against Python 2.5 because that's where I noticed it, but it doesn't lo

[issue3710] Reference leak in thread._local

2008-08-27 Thread Ben Cottrell
Ben Cottrell <[EMAIL PROTECTED]> added the comment: But then if there is a context switch during the last Py_XDECREF, then it could be the case that self->dict is not set properly on return from _ldict(). Functions like local_setattro() use _ldict() more for its side effect (setting s

[issue3710] Reference leak in thread._local

2008-08-27 Thread Ben Cottrell
Ben Cottrell <[EMAIL PROTECTED]> added the comment: The specific thing that was happening for me is that an _sqlite3.Connection object was in the dictionary. In Modules/_sqlite/connection.c, in pysqlite_connection_dealloc(), it uses Py_BEGIN_ALLOW_THREADS/Py_END_ALLOW_THREADS. So it'

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

2008-08-28 Thread Ben Cottrell
Ben Cottrell <[EMAIL PROTECTED]> added the comment: I like this patch, too! I think it's a much cleaner way of implementing the thread._local type. However, when I test it, I have problems with subclasses of thread._local; using the class itself seems to work. I've attached a t

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

2008-08-28 Thread Ben Cottrell
Ben Cottrell <[EMAIL PROTECTED]> 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 rig