[issue17852] Built-in module _io can loose data from buffered files at exit

Antoine Pitrou report at bugs.python.org
Sat Apr 27 13:40:28 CEST 2013


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 <report at bugs.python.org>
<http://bugs.python.org/issue17852>
_______________________________________


More information about the Python-bugs-list mailing list