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

2010-08-30 Thread Nick Coghlan
Changes by Nick Coghlan ncogh...@gmail.com: -- nosy: +ncoghlan ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1868 ___ ___ Python-bugs-list mailing

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

2010-08-28 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Thank you Gregory. I've committed the patch in r84344 (py3k), r84345 (3.1) and r84346 (2.7). -- resolution: - fixed stage: - committed/rejected status: open - closed ___ Python tracker

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

2010-08-22 Thread Gregory P. Smith
Gregory P. Smith g...@krypto.org added the comment: your updated patch looks good to me. i've posted it here for easy review if anyone else wants to take a look: http://codereview.appspot.com/1995049/ -- assignee: gregory.p.smith - pitrou ___

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

2010-08-21 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: The original patch won't apply anymore, because of changes in the thread._local implementation. Instead, here is a new patch, which also adds tests for the __dict__ behaviour, and two new private API functions:

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

2010-08-21 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: It should be noted that the original reason for this issue is already gone in SVN (as part of the reimplementation alluded to above), but the timing fragility is still there since there can be a thread switch between the moment the dict member

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

2010-05-11 Thread Terry J. Reedy
Changes by Terry J. Reedy tjre...@udel.edu: -- versions: +Python 2.7, Python 3.1, Python 3.2 -Python 3.0 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1868 ___

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

2008-12-10 Thread Martin v. Löwis
Martin v. Löwis [EMAIL PROTECTED] added the comment: Since no specific patch was proposed for 2.5.3, I'm untargetting it for 2.5. -- versions: -Python 2.5, Python 2.5.3 ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue1868

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

2008-11-29 Thread Martin v. Löwis
Martin v. Löwis [EMAIL PROTECTED] added the comment: Is any of the patches believed to be ready? ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue1868 ___ ___

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

2008-11-29 Thread Martin v. Löwis
Martin v. Löwis [EMAIL PROTECTED] added the comment: Reconsidering: I think the needs review keyword should only be applied if there is a single patch associated with the issue that needs review. So anybody setting the keyword should remove all patches that don't need review anymore (as they are

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

2008-11-28 Thread Gregory P. Smith
Changes by Gregory P. Smith [EMAIL PROTECTED]: -- versions: +Python 2.5.3 ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue1868 ___ ___ Python-bugs-list

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

2008-09-10 Thread Martin v. Löwis
Martin v. Löwis [EMAIL PROTECTED] added the comment: If Christian's analysis is right, and memory is released except for the last thread, I don't think this qualifies as a release blocker. Also (unless I misinterpret the issue), it seems that we have made many releases already which had this

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

2008-09-10 Thread Gregory P. Smith
Gregory P. Smith [EMAIL PROTECTED] added the comment: Agreed, this is fine for a bugfix point release. I was initially concerned about the Modules/threadmodule.c struct localobject changing but that is private and used only by code within threadmodule.c so its not part of an API anything else

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

2008-09-09 Thread Barry A. Warsaw
Changes by Barry A. Warsaw [EMAIL PROTECTED]: -- priority: deferred blocker - release blocker ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue1868 ___

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

2008-09-08 Thread Gregory P. Smith
Gregory P. Smith [EMAIL PROTECTED] added the comment: i won't have time to work on this for several days but i will happily review updated patches if anyone could contribute fixes for the __dict__ issues described in the most recent comments. feel free to steal the issue from me.

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

2008-09-03 Thread Benjamin Peterson
Changes by Benjamin Peterson [EMAIL PROTECTED]: -- priority: release blocker - deferred blocker ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue1868 ___

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

2008-09-02 Thread Gregory P. Smith
Gregory P. Smith [EMAIL PROTECTED] added the comment: this is ready for more review at http://codereview.appspot.com/3641 Added file: http://bugs.python.org/file11341/threading_local4.patch ___ Python tracker [EMAIL PROTECTED]

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

2008-09-02 Thread Antoine Pitrou
Antoine Pitrou [EMAIL PROTECTED] added the comment: The patch is basically fine with me. While reviewing it I've found out that threading.local doesn't have cyclic garbage collecting enabled. I've opened a new issue for it in #3757. -- nosy: +pitrou

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

2008-09-02 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc [EMAIL PROTECTED] added the comment: With the patch, subclasses of threading.local seem to have an empty __dict__: import threading class MyLocal(threading.local): pass l = MyLocal() l.x = 2 l.__dict__ # returns {} Maybe __dict__ should be special-cased in

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

2008-09-02 Thread Christian Heimes
Christian Heimes [EMAIL PROTECTED] added the comment: Amaury Forgeot d'Arc wrote: Maybe __dict__ should be special-cased in local_getattro()? With the patch it's also no longer possible to get a list of attribute names. +1 for special casing __dict__ in getattro and setattro. setattr(local,

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

2008-09-01 Thread Gregory P. Smith
Changes by Gregory P. Smith [EMAIL PROTECTED]: -- assignee: - gregory.p.smith ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue1868 ___ ___

[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 test program that

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

2008-08-28 Thread Christian Heimes
Christian Heimes [EMAIL PROTECTED] added the comment: Good catch, Ben! The generic setattr/getattr functions don't work as expected when the base class doesn't provide a __dict__. They are setting the attributes in the subclass' __dict__ instead of the thread local dict. My patch fixes the

[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 right than it would

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

2008-08-27 Thread Gregory P. Smith
Changes by Gregory P. Smith [EMAIL PROTECTED]: -- keywords: +patch nosy: +gregory.p.smith ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue1868 ___ ___

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

2008-08-27 Thread Gregory P. Smith
Gregory P. Smith [EMAIL PROTECTED] added the comment: see also #3710 ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue1868 ___ ___ Python-bugs-list mailing list

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

2008-08-27 Thread Gregory P. Smith
Gregory P. Smith [EMAIL PROTECTED] added the comment: I like Amaury's patch, it gets rid of what seems like an existing gross hack of having localobject-dict exist at all. I believe it may also fix #3710 by getting rid of the unnecessary localobject-dict member. Could someone else please

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

2008-01-19 Thread Christian Heimes
Christian Heimes added the comment: I've added a test in r60075. It shows that threading.local cleans up thread local data except for the last stopped thread. -- nosy: +tiran __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1868

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

2008-01-19 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: On the opposite, simply evaluating local.__dict__ just before deadlist = ..., frees the last value. Weird? I found that in threadmodule.c, the local object has a self-dict attribute, which contains the last used dictionary. The dictionaries switch

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

2008-01-19 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Here is a patch that removes the member localobject-dict. Now the dictionary is always retrieved from the thread state. Added file: http://bugs.python.org/file9225/threading_local.patch __ Tracker [EMAIL PROTECTED]

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

2008-01-18 Thread Peter Fein
New submission from Peter Fein: threading.local doesn't free attributes assigned to a local() instance when the assigning thread exits. See attached patch for _threading_local.py doctests. Per discussion with Crys and arkanes in #python, this may be an issue with PyThreadState_Clear /

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

2008-01-18 Thread Christian Heimes
Changes by Christian Heimes: -- components: +Extension Modules priority: - high versions: +Python 2.6, Python 3.0 __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1868 __