F
Florian Lindner
Hello,
I try to compute SHA hashes for different files:
for root, dirs, files in os.walk(sys.argv[1]):
for file in files:
path = os.path.join(root, file)
print path
f = open(path)
sha = sha.new(f.read())
sha.update(f.read())
print sha.hexdigest()
this generates a traceback when sha.new() is called for the second time:
/home/florian/testdir/testfile
c95ad0ce54f903e1568facb2b120ca9210f6778f
/home/florian/testdir/testfile2
Traceback (most recent call last):
File "duplicatefinder.py", line 11, in ?
sha = sha.new(f.read())
AttributeError: new
What is wrong there?
Thanks,
Florian
I try to compute SHA hashes for different files:
for root, dirs, files in os.walk(sys.argv[1]):
for file in files:
path = os.path.join(root, file)
print path
f = open(path)
sha = sha.new(f.read())
sha.update(f.read())
print sha.hexdigest()
this generates a traceback when sha.new() is called for the second time:
/home/florian/testdir/testfile
c95ad0ce54f903e1568facb2b120ca9210f6778f
/home/florian/testdir/testfile2
Traceback (most recent call last):
File "duplicatefinder.py", line 11, in ?
sha = sha.new(f.read())
AttributeError: new
What is wrong there?
Thanks,
Florian