[issue2521] ABC caches should use weak refs

2011-05-13 Thread H.
H. demirhan...@gmail.com added the comment: ImportError: No module named _weakrefset Here are some references while i was trying to install Pinax framework. http://paste.pound-python.org/show/6536/ And i saw that the _weakrefset.py is not included in the package. So I have copied from

[issue2521] ABC caches should use weak refs

2011-05-13 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: bluag: the script you run contains a list of some modules required to start Python (I found a copy here: https://github.com/pinax/pinax/raw/master/scripts/pinax-boot.py ) This script is obviously out of date wrt the new version of

[issue2521] ABC caches should use weak refs

2010-08-20 Thread Benjamin Peterson
Benjamin Peterson benja...@python.org added the comment: r84230 -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2521 ___

[issue2521] ABC caches should use weak refs

2010-08-20 Thread Daniel Stutzbach
Daniel Stutzbach dan...@stutzbachenterprises.com added the comment: Thanks! :-) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2521 ___ ___

[issue2521] ABC caches should use weak refs

2010-08-18 Thread Daniel Stutzbach
Daniel Stutzbach dan...@stutzbachenterprises.com added the comment: Benjamin, Thanks for the feedback. Since you only commented on the test case, may I assume that the fix itself looked good to you? I will work on revising the test case based on your comments. Since I ran into the bug

[issue2521] ABC caches should use weak refs

2010-08-18 Thread Daniel Stutzbach
Changes by Daniel Stutzbach dan...@stutzbachenterprises.com: -- components: +Library (Lib) -Interpreter Core versions: -Python 2.6 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2521 ___

[issue2521] ABC caches should use weak refs

2010-08-18 Thread Daniel Stutzbach
Daniel Stutzbach dan...@stutzbachenterprises.com added the comment: Attached is a new test case, based on Benjamin's comments. -- Added file: http://bugs.python.org/file18567/leak_test2.patch ___ Python tracker rep...@bugs.python.org

[issue2521] ABC caches should use weak refs

2010-08-16 Thread Benjamin Peterson
Benjamin Peterson benja...@python.org added the comment: Some comments: - The test should be in test_abc.py and should probably not use a collections class. - Use test_support.gc_collect(). - What's the __len__() stuff for? -- keywords: -26backport

[issue2521] ABC caches should use weak refs

2010-08-09 Thread Daniel Stutzbach
Daniel Stutzbach dan...@stutzbachenterprises.com added the comment: Jack, The change is necessary because None in WeakSet() would throw an exception. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2521

[issue2521] ABC caches should use weak refs

2010-08-05 Thread Mark Lawrence
Mark Lawrence breamore...@yahoo.co.uk added the comment: Can a committer take a look at this please. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2521 ___

[issue2521] ABC caches should use weak refs

2010-08-05 Thread Jack Diederich
Jack Diederich jackd...@gmail.com added the comment: This is a change in the codepath for instances that don't have __class__ defined. subclass = getattr(instance, '__class__', None) -if subclass in cls._abc_cache: +if subclass is not None and subclass in

[issue2521] ABC caches should use weak refs

2010-07-19 Thread Mark Lawrence
Mark Lawrence breamore...@yahoo.co.uk added the comment: Patched the unit test, then ran the test before applying the fix which failed, after applying the fix the test ran successfully. Tested on Windows Vista 32 bit against 2.7 maintainance release. The patches are short and sweet, I see

[issue2521] ABC caches should use weak refs

2010-05-17 Thread Daniel Stutzbach
Daniel Stutzbach dan...@stutzbachenterprises.com added the comment: Antoine, do you have a suggestion for someone with with better knowledge of ABCs to do the final review, so that I may very politely pester them? ;-) -- ___ Python tracker

[issue2521] ABC caches should use weak refs

2010-05-17 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Antoine, do you have a suggestion for someone with with better knowledge of ABCs to do the final review, so that I may very politely pester them? ;-) I guess Benjamin could. -- ___ Python tracker

[issue2521] ABC caches should use weak refs

2010-04-26 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Someone with a better knowledge of ABCs than me should probably do a final review of this. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2521

[issue2521] ABC caches should use weak refs

2010-04-26 Thread Daniel Stutzbach
Daniel Stutzbach dan...@stutzbachenterprises.com added the comment: Someone with appropriate permissions want to update the Stage? -- versions: +Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2521

[issue2521] ABC caches should use weak refs

2010-04-26 Thread Michael Foord
Changes by Michael Foord mich...@voidspace.org.uk: -- stage: unit test needed - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2521 ___

[issue2521] ABC caches should use weak refs

2010-03-31 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Make old-style classes weak-referenceable Now done (r79535). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2521 ___

[issue2521] ABC caches should use weak refs

2010-03-31 Thread Daniel Stutzbach
Daniel Stutzbach dan...@stutzbachenterprises.com added the comment: Cool! I will revise the patch based on your comments about my test case. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2521

[issue2521] ABC caches should use weak refs

2010-03-31 Thread Daniel Stutzbach
Daniel Stutzbach dan...@stutzbachenterprises.com added the comment: New patches uploaded. I separated out the patch to add the test case, to make it easier to test before and after applying the fix. -- Added file: http://bugs.python.org/file16714/leak_test.patch

[issue2521] ABC caches should use weak refs

2010-03-31 Thread Daniel Stutzbach
Changes by Daniel Stutzbach dan...@stutzbachenterprises.com: Removed file: http://bugs.python.org/file16690/abc_leak.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2521 ___

[issue2521] ABC caches should use weak refs

2010-03-30 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- dependencies: +Make old-style classes weak referenceable ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2521 ___

[issue2521] ABC caches should use weak refs

2010-03-30 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Hmm, Benjamin pointed out that ABCs only support new-style classes, so old-style classes could be detected early instead of being added to the _abc_negative_cache. -- ___ Python tracker

[issue2521] ABC caches should use weak refs

2010-03-30 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: By the way, Daniel, your patch doesn't look right. First, you shouldn't need all the sortedlist/sortedset hierarchy. Second, len(gc.get_objects()) is a truly horrible way of checking the classes have been destroyed. Just take a weakref to the

[issue2521] ABC caches should use weak refs

2010-03-30 Thread Daniel Stutzbach
Daniel Stutzbach dan...@stutzbachenterprises.com added the comment: I hadn't realized that old style classes didn't support ABCs. That certainly simplifies things! I'm working on a new patch. -- ___ Python tracker rep...@bugs.python.org

[issue2521] ABC caches should use weak refs

2010-03-30 Thread Daniel Stutzbach
Daniel Stutzbach dan...@stutzbachenterprises.com added the comment: Are you sure the old-style classes don't support ABCs? ABCTestCase.validate_isinstance in Lib/test/test_collection.py specifically tests that both new-style and old-style classes work, unless I'm reading it wrong. (and those

[issue2521] ABC caches should use weak refs

2010-03-30 Thread Benjamin Peterson
Benjamin Peterson benja...@python.org added the comment: In those cases, it's because __subclasscheck__ is overridden. You can't register a old-style class. -- nosy: +benjamin.peterson ___ Python tracker rep...@bugs.python.org

[issue2521] ABC caches should use weak refs

2010-03-30 Thread Florent Xicluna
Florent Xicluna florent.xicl...@gmail.com added the comment: ABCTestCase.validate_isinstance ... specifically tests that both new-style and old-style classes work... I fixed some parts with issue #7624, and changeset r78800. -- ___ Python tracker

[issue2521] ABC caches should use weak refs

2010-03-30 Thread Daniel Stutzbach
Daniel Stutzbach dan...@stutzbachenterprises.com added the comment: You can't register an old-style class, but many ABCs support duck-typing by implementing __subclasshook__. ABCMeta caches those results and stores a reference to old-style classes, sometimes in _abc_cache and sometimes in

[issue2521] ABC caches should use weak refs

2010-03-29 Thread Daniel Stutzbach
Daniel Stutzbach dan...@stutzbachenterprises.com added the comment: Now that WeakSet has been backported to trunk, I've backported the fix for this reference-leak (patch with test case attached). However, after making the patch, I discovered that old-style classes are not weak-referenceable.

[issue2521] ABC caches should use weak refs

2009-05-13 Thread Daniel Diniz
Daniel Diniz aja...@gmail.com added the comment: Confirmed on release26-maint and trunk. -- nosy: +ajaksu2 priority: - normal stage: - test needed type: - resource usage ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2521

[issue2521] ABC caches should use weak refs

2008-05-07 Thread Antoine Pitrou
Changes by Antoine Pitrou [EMAIL PROTECTED]: -- nosy: +pitrou __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2521 __ ___ Python-bugs-list mailing list Unsubscribe:

[issue2521] ABC caches should use weak refs

2008-03-31 Thread Amaury Forgeot d'Arc
New submission from Amaury Forgeot d'Arc [EMAIL PROTECTED]: The following function seems to 8 references each time it is run: import io, gc def f(): class C: pass c=C() assert isinstance(c, io.StringIO) is False gc.collect();gc.collect();gc.collect() This is because