]> git.ipfire.org Git - location/libloc.git/blobdiff - src/python/downloader.py
location(8): Remove any temporary files after unsuccessful downloads
[location/libloc.git] / src / python / downloader.py
index 5caad5188a4502b44a526638ca44135c1efe70cc..87bbb685043677f6a4a21689abd3c34aa3ce6295 100644 (file)
@@ -180,6 +180,9 @@ class Downloader(object):
                                        # Return temporary file
                                        return t
 
+               # Delete the temporary file after unsuccessful downloads
+               os.unlink(t.name)
+
                raise FileNotFoundError(url)
 
        def _check_database(self, f, public_key, timestamp=None):