Message 187898 - Python tracker

This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Content
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