Skip to content

Commit

Permalink
Fix encoding issues for ConvertExternalData
Browse files Browse the repository at this point in the history
  • Loading branch information
shabiel committed Jun 16, 2020
1 parent 8df4f5c commit bf14706
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Scripts/ConvertToExternalData.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ def generateSha1Sum(inputFilename):
buf = old_div(fileSize,50)
if buf > MAX_READ_SIZE:
buf = MAX_READ_SIZE
with open(inputFilename, "r") as inputFile:
with open(inputFilename, "rb") as inputFile:
return generateSha1SumCommon(inputFile, buf)

""" utility method to generate sha1 hash key for file like object """
Expand All @@ -194,7 +194,7 @@ def generateSha1SumCommon(fileObject, buf=1024):
while True:
nByte = fileObject.read(buf)
if nByte:
hashString += codecs.encode(nByte, encoding="ascii", errors='ignore')
hashString += nByte
else:
break
return hashlib.sha1(hashString).hexdigest()
Expand Down

0 comments on commit bf14706

Please sign in to comment.