From bf14706b85dbc0f3ebd98433b07ebcdd6dc110ff Mon Sep 17 00:00:00 2001 From: Sam Habiel Date: Tue, 16 Jun 2020 15:41:35 -0400 Subject: [PATCH] Fix encoding issues for ConvertExternalData --- Scripts/ConvertToExternalData.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Scripts/ConvertToExternalData.py b/Scripts/ConvertToExternalData.py index 8a1362234..57a94a5cc 100644 --- a/Scripts/ConvertToExternalData.py +++ b/Scripts/ConvertToExternalData.py @@ -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 """ @@ -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()