Message308419
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. |
|
Date |
User |
Action |
Args |
2017-12-15 18:36:23 | nascheme | set | recipients:
+ nascheme, tim.peters, pitrou, vstinner, nikratio, neologix, martin.panter, serhiy.storchaka, xgdomingo |
2017-12-15 18:36:23 | nascheme | set | messageid: <1513362983.74.0.213398074469.issue17852@psf.upfronthosting.co.za> |
2017-12-15 18:36:23 | nascheme | link | issue17852 messages |
2017-12-15 18:36:23 | nascheme | create | |
|