Antoine Pitrou added the comment:

There are actually several issues here:

* collection of globals at shutdown is wonky: you should add an explicit "del 
a,f; gc.collect()" at the end of the script

* order of tp_clear calls, or another issue with TextIOWrapper: if you open the 
file in binary mode ("f = open('...', 'wb'); f.write(b'bar')"), the data gets 
flushed during the GC run

----------
nosy: +pitrou

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue17852>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to