Prevent UnicodeEncodeError: 'ascii' codec can't encode characters in position ...: ordinal not in range(128)

This commit is contained in:
Andrey Shorin 2013-09-24 16:14:20 +04:00
commit 21f5bc4242

View file

@ -410,7 +410,7 @@ def md5s(data):
buf = StringIO.StringIO(data)
digest = _md5()
digest.update(buf.read())
digest.update(buf.read().encode('utf-8'))
return digest.hexdigest()
def md5(filename):