So, from what I've read, it is basically impossible to reopen files created by the tempfile module on subsequent runs. This would kind of defeat the purpose of saving the cached files for testing, since the idea is to be able to open a local file (instead of downloading from a url) to read the data to be parsed. This is suppose to be only used for testing, however, since there is apparent concern for race conditions here; I will go ahead and change the code a little so that the file is locked when opened for writing.