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 pitrou
Recipients brett.cannon, eric.snow, loewis, ncoghlan, pitrou, sbt
Date 2013-08-06.20:38:50
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1375821531.36.0.318072139637.issue18674@psf.upfronthosting.co.za>
In-reply-to
Content
modules_by_index is a near-eternal store for extension modules. It is only collected at the end of interpreter shutdown, which is much too late for regular garbage collection. This patch proposes instead to store weak references in modules_by_index, so that extension modules can be collected in a normal way when they are removed from sys.modules.

The only gotcha is that PyState_FindModule returns a borrowed reference. With this change, it becomes really important to incref the returned reference as soon as possible.
History
Date User Action Args
2013-08-06 20:38:51pitrousetrecipients: + pitrou, loewis, brett.cannon, ncoghlan, sbt, eric.snow
2013-08-06 20:38:51pitrousetmessageid: <1375821531.36.0.318072139637.issue18674@psf.upfronthosting.co.za>
2013-08-06 20:38:51pitroulinkissue18674 messages
2013-08-06 20:38:51pitroucreate