The temporary file should be cleaned up if it can be.
Current Behavior
The file is never cleaned up.
303 was written assuming that the file could be useful, but I'm so sure any more.
Possible Solution
Try/except clean up the file.
This doesn't need to be particularly robust, it just need to be a best-effort cleanup. Leaving the file around is not fatal.
As a bonus, the filename of the temp file can be simplified to just a hash.
Expected Behavior
The temporary file should be cleaned up if it can be.
Current Behavior
The file is never cleaned up.
303 was written assuming that the file could be useful, but I'm so sure any more.
Possible Solution
Try/except clean up the file. This doesn't need to be particularly robust, it just need to be a best-effort cleanup. Leaving the file around is not fatal. As a bonus, the filename of the temp file can be simplified to just a hash.