Temp file cleanup relies on graceful interpreter exit
Created originally on Bitbucket by Anonymous
The temp files that are acquired using get_tempfile are only cleaned up in cleanup_tempfiles, which is called when the interpreter is gracefully closed. In the case that there is an abrupt exit of the program, the temp files are not deleted, which clutters the filesystem.
A better way to do this would be to clean up the files as they're done being used. One way to do this would be to have a close or a finalize method in the Workbook class. The trick would be to get the Workbook class to remember which files it is using and selectively clean those up. Maybe rather than storing the filenames in the global XML_TEMP_FILES list, it could be stored as a list within the Workboook object itself.