Message232122
| Author |
pitrou |
| Recipients |
arigo, neologix, nikratio, pitrou, serhiy.storchaka, tim.peters, vstinner |
| Date |
2014年12月04日.10:46:20 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1417689980.82.0.0243195945479.issue17852@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
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?). |
|