Matthias Güntert <[EMAIL PROTECTED]> writes: > i am in the process of writing a python script to backup my data. Now I > would like to implement md5/sha1 hashes.
Try editing as follows: change > f = open(fname, "rb") > while 1: > block = f.read(1024*1024) > if not block: > break > # generate the hash > m.update(block) > f.close() to: f = open(fname, "rb") nbytes = 0 while 1: block = f.read(1024*1024) nbytes += len(block) if not block: break # generate the hash m.update(block) f.close() print '%d bytes processed' As Adam DePrince noticed, the md5 checksum you generated was that of an empty file. So the above should tell you whether you're actually processing any input; if you don't get the expected number of bytes, debug from there. -- http://mail.python.org/mailman/listinfo/python-list