md5 hash problems

Michele michele at nectarine.it
Tue Sep 30 23:25:49 CEST 2008


Hi there,
why is this code generating a problem?

>>> input = open('foo.img','rb').read().decode('ISO-8859-1')
>>> import md5
>>> md5.new(input).hexdigest()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
UnicodeEncodeError: 'ascii' codec can't encode character u'\xdc' in
position 6:
ordinal not in range(128)
>>>

Thank you.



More information about the Python-list mailing list