diff core/download.py @ 976:f5aa74dcdd7a

Ensure temporary files get deleted during hotlinking.
author Brian Neal <bgneal@gmail.com>
date Mon, 05 Oct 2015 20:07:44 -0500
parents 6f55c086db1e
children a6331579ff43
line wrap: on
line diff
--- a/core/download.py	Mon Oct 05 20:06:24 2015 -0500
+++ b/core/download.py	Mon Oct 05 20:07:44 2015 -0500
@@ -49,6 +49,7 @@
             shutil.copyfileobj(r.raw, fp)
     except requests.RequestException:
         logger.exception("download_file download exception")
+        os.remove(path)
         raise
 
     file_size = os.stat(path).st_size