wmlscope: fixed files being incorrectly opened as UTF8 instead of binary

This commit is contained in:
Elvish_Hunter 2015-08-05 12:46:01 +02:00
parent 90919e12c6
commit 778e9296d8

View file

@ -446,7 +446,7 @@ Usage: wmlscope [options] dirpath
if collisions:
collisions = []
for (namespace, filename) in xref.filelist.generator():
with codecs.open(filename, "r", "utf8") as ifp:
with open(filename, "rb") as ifp: # this one may be an image or a sound, so don't assume UTF8 encoding
collisions.append(hashlib.md5(ifp.read()).digest())
collisions = zip(xref.filelist.flatten(), collisions)
hashcounts = {}