Fix more problems with "/usr/bin/env python" picking python3.

Open files in 'rb' (read binary) mode to prevent useless default utf8
encoding in python3, without breaking python2 compatibility.

Reported-by: Tharre <tharre3@gmail.com>
This commit is contained in:
Avery Pennarun 2019-05-15 16:53:49 -07:00
commit fb0a5bd69c
2 changed files with 3 additions and 3 deletions

View file

@ -8,7 +8,7 @@ subprocess.check_call([
], close_fds=False)
h = hashlib.sha256()
f = open(sys.argv[2])
f = open(sys.argv[2], 'rb')
while 1:
b = f.read(65536)
if not b: break