EP wrote: > This inquiry may either turn out to be about the suitability of the > SHA-1 (160 bit digest) for file identification, the sha function in > Python ... or about some error in my script. > > This is on Windows XP. > > def hashit(pth): > fs=open(pth,'r').read() > sh=sha.new(fs).hexdigest() > return sh >
cannot comment on the suitability of SHA for your use-case but shouldn't you be opening the file in binary mode? fs=open(pth,'rb').read() -- http://mail.python.org/mailman/listinfo/python-list