build: read node files as binary files (#28729)

This commit is contained in:
John Kleinschmidt 2021-04-19 15:55:17 -04:00 committed by GitHub
parent 400d7c4bce
commit 8164322195
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -88,7 +88,7 @@ def create_checksum(algorithm, directory, filename, files):
lines = [] lines = []
for path in files: for path in files:
h = hashlib.new(algorithm) h = hashlib.new(algorithm)
with open(path, 'r') as f: with open(path, 'rb') as f:
h.update(f.read()) h.update(f.read())
lines.append(h.hexdigest() + ' ' + os.path.relpath(path, directory)) lines.append(h.hexdigest() + ' ' + os.path.relpath(path, directory))