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 josh.r
Recipients josh.r, pitrou, serhiy.storchaka
Date 2014-12-04.23:27:38
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1417735658.55.0.772757218818.issue22996@psf.upfronthosting.co.za>
In-reply-to
Content
What is the proposal? Global registration of file objects that should be flushed before cleanup when they participate in a reference cycle? Adding a special "__predel__" method as suggested in the linked bug? Weak backrefs for file objects that allow a child being destroyed to flush/close its parent (recursively) such that the top of the I/O wrapping chain is always flushed/closed first? Something else?

The underlying problem is that people don't use with statements or otherwise explicitly close their objects, and 99.9% of the time, they get away with it in CPython because of the deterministic reference counting for non-cycles and the finalizers. I'm not sure it's worth adding new complexity (to the interpreter or the I/O hierarchy) to address an issue that can be fixed by closing your files properly, which is already recommended practice.
History
Date User Action Args
2014-12-04 23:27:38josh.rsetrecipients: + josh.r, pitrou, serhiy.storchaka
2014-12-04 23:27:38josh.rsetmessageid: <1417735658.55.0.772757218818.issue22996@psf.upfronthosting.co.za>
2014-12-04 23:27:38josh.rlinkissue22996 messages
2014-12-04 23:27:38josh.rcreate