Message232122
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?). |
|
Date |
User |
Action |
Args |
2014-12-04 10:46:20 | pitrou | set | recipients:
+ pitrou, tim.peters, arigo, vstinner, nikratio, neologix, serhiy.storchaka |
2014-12-04 10:46:20 | pitrou | set | messageid: <1417689980.82.0.0243195945479.issue17852@psf.upfronthosting.co.za> |
2014-12-04 10:46:20 | pitrou | link | issue17852 messages |
2014-12-04 10:46:20 | pitrou | create | |
|