This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author stutzbach
Recipients ajaksu2, amaury.forgeotdarc, flox, pitrou, stutzbach
Date 2010-03-29.22:21:32
SpamBayes Score 1.1371237e-11
Marked as misclassified No
Message-id <1269901296.71.0.755179068212.issue2521@psf.upfronthosting.co.za>
In-reply-to
Content
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.  Consequently, the patch is not suitable for commiting.  

If old-style classes can be made weak-referenceable, then the patch should work.  If not, then this bug is essentially impossible to solve in 2.x unless the ABC cache is done away with entirely.

Other notes:

Since abc.py is imported during bootstrapping before paths are set up, I needed to add _weakref as a built-in module.  (It's already a built-in module in the py3k branch.)

Since the patch tweaks Modules/Setup.dist, you need to "make distclean" and rerun ./configure after applying the patch.

Also, on unpatched trunk the example posted by Amaury no longer seems to trigger the issue.  However, the example I posted in Issue 8022 still triggers the leak.  I used that as the basis for the test case in the patch.
History
Date User Action Args
2010-03-29 22:21:36stutzbachsetrecipients: + stutzbach, amaury.forgeotdarc, pitrou, ajaksu2, flox
2010-03-29 22:21:36stutzbachsetmessageid: <1269901296.71.0.755179068212.issue2521@psf.upfronthosting.co.za>
2010-03-29 22:21:34stutzbachlinkissue2521 messages
2010-03-29 22:21:34stutzbachcreate