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 nascheme
Recipients martin.panter, nascheme, neologix, nikratio, pitrou, serhiy.storchaka, tim.peters, vstinner, xgdomingo
Date 2017-12-15.18:36:23
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1513362983.74.0.213398074469.issue17852@psf.upfronthosting.co.za>
In-reply-to
Content
Using reversed chronological order would work in 99% of the cases probably but then you would have that rare case where it didn't work.  So, I'm not too keen on that approach.

I think this is a classic problem with finalization and GC, probably should do some actual reading of literature.  One idea that occurs to me is that the underlying file object could keep a weakref to the higher level (e.g. buffer) objects.  Then, if the underlying file gets closes, it could make sure to call flush on the higher level objects first.  The weakref would ensure that a ref cycle is not created.
History
Date User Action Args
2017-12-15 18:36:23naschemesetrecipients: + nascheme, tim.peters, pitrou, vstinner, nikratio, neologix, martin.panter, serhiy.storchaka, xgdomingo
2017-12-15 18:36:23naschemesetmessageid: <1513362983.74.0.213398074469.issue17852@psf.upfronthosting.co.za>
2017-12-15 18:36:23naschemelinkissue17852 messages
2017-12-15 18:36:23naschemecreate