Message232161
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. |
|
Date |
User |
Action |
Args |
2014-12-04 23:27:38 | josh.r | set | recipients:
+ josh.r, pitrou, serhiy.storchaka |
2014-12-04 23:27:38 | josh.r | set | messageid: <1417735658.55.0.772757218818.issue22996@psf.upfronthosting.co.za> |
2014-12-04 23:27:38 | josh.r | link | issue22996 messages |
2014-12-04 23:27:38 | josh.r | create | |
|