]> git.ipfire.org Git - people/shoehn/ipfire.org.git/commitdiff
Fix hashing of big files.
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 14 Jan 2011 16:02:53 +0000 (17:02 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 14 Jan 2011 16:02:53 +0000 (17:02 +0100)
www/webapp/backend/releases.py

index 9b82c13255e8ea01ef87188fe17c2c47ab74bbf8..7ce641d7e277e4ce77e38cfb5c7c22f14f3deb71 100644 (file)
@@ -163,7 +163,11 @@ class Release(object):
                sha1 = hashlib.sha1()
 
                with open(filename) as f:
-                       sha1.update(f.read())
+                       buf_size = 1024
+                       buf = f.read(buf_size)
+                       while buf:
+                               sha1.update(buf)
+                               buf = f.read(buf_size)
 
                return sha1.hexdigest()