Re: Problem with sha.new

2005-07-09 Thread Rob Williscroft
Florian Lindner wrote in news:[EMAIL PROTECTED] in comp.lang.python: > 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)

Re: Problem with sha.new

2005-07-09 Thread Dan Sommers
On Sat, 09 Jul 2005 13:49:12 +0200, Florian Lindner <[EMAIL PROTECTED]> wrote: > 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(

Re: Problem with sha.new

2005-07-09 Thread John Machin
Florian Lindner wrote: > 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) print "sha is", repr(sha) ### self-help !!!

Re: Problem with sha.new

2005-07-09 Thread and-google
Florian Lindner wrote: > sha = sha.new(f.read()) > this generates a traceback when sha.new() is called for the second time You have reassigned the variable 'sha'. First time around, sha is the sha module object as obtained by 'import sha'. Second time around, sha is the SHA hashing obje

Problem with sha.new

2005-07-09 Thread 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