Use StringIO to feed md5 calculation to prevent unicode issues
Fixes #4014
This commit is contained in:
parent
2a47f72139
commit
4e9dee6093
1 changed files with 2 additions and 1 deletions
|
@ -393,8 +393,9 @@ def merge_hash(a, b):
|
|||
def md5s(data):
|
||||
''' Return MD5 hex digest of data. '''
|
||||
|
||||
buf = StringIO.StringIO(data)
|
||||
digest = _md5()
|
||||
digest.update(data.encode('utf-8'))
|
||||
digest.update(buf.read())
|
||||
return digest.hexdigest()
|
||||
|
||||
def md5(filename):
|
||||
|
|
Loading…
Reference in a new issue