explicitly close http-response and file objects after downloading them
authorThomas Schmidt <tschmidt@debian.org>
Mon, 26 Oct 2009 08:19:33 +0000 (09:19 +0100)
committerThomas Schmidt <tschmidt@debian.org>
Mon, 26 Oct 2009 08:19:33 +0000 (09:19 +0100)
canola-flickr/flickr/manager.py

index 5d93b4d..84e87b2 100644 (file)
@@ -172,9 +172,11 @@ class DownloadManager:
                 pass
 
             content = response.read()
+            response.close()
 
             file = open(local_path, 'w')
             file.write(content)
+            file.close()
 
             if self.verbose: print "downloading file %s to %s - success" % (url, local_path)
             return True