MD5 problem

fargo fargo_01 at hotmail.com
Mon Jun 13 09:09:11 EDT 2005


Roel Schroeven wrote:
> fargo wrote:
> 
>> Hi.
>>
>> I'm in trouble with the md5 module.
>>
>> Under Linux, it's ok, I get real signatures.
>>
>> The problem is under Windows XP, with some kind of files.
>>
>> If I use the md5 module with .txt files, it'ok.
>>
>> The Problem comes from the .msg files. I get the same signature for 
>> every .msg file I try to hash with the md5 algorithm. I think some 
>> character are strange for python, and makes it stop before the end of 
>> the .msg file.
> 
> 
> That sounds like you opened the file in text mode. For things like this 
> it is better to open it in binary mode: file(filename, 'rb')

It was excatly the problem.

Thank you for your help.



More information about the Python-list mailing list