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 arigo, neologix, nikratio, pitrou, serhiy.storchaka, tim.peters, vstinner
Date 2014-12-04.10:46:20
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1417689980.82.0.0243195945479.issue17852@psf.upfronthosting.co.za>
In-reply-to
Content
The problem is that the order of tp_finalize calls is arbitrary when there is a reference cycle (same thing, of course, with tp_clear). So depending on the exact layout of the garbage list, the TextIOWrapper could be collected before the BufferedWriter and the FileIO (good), or after (bad).

I don't see an easy way to solve this. Either _io should provide hints to the GC (which kind of hints?), or the tp_finalize should be customized to somehow call a dependent wrapper's tp_finalize (how? by keeping a weakref?).
History
Date User Action Args
2014-12-04 10:46:20pitrousetrecipients: + pitrou, tim.peters, arigo, vstinner, nikratio, neologix, serhiy.storchaka
2014-12-04 10:46:20pitrousetmessageid: <1417689980.82.0.0243195945479.issue17852@psf.upfronthosting.co.za>
2014-12-04 10:46:20pitroulinkissue17852 messages
2014-12-04 10:46:20pitroucreate