Bug 1323304 - Open the file as binary in order to let Windows read it properly when generating the hash. r=felipe
authorAnthony Hughes <anthony.s.hughes@gmail.com>
Wed, 21 Dec 2016 17:39:36 -0200
changeset 102 38ce1b1eea2ce396b3566c878f4f79da3fcbc547
parent 101 81e9365425387ab9734fece259df576b5d623c09
child 103 a694a95fc5a19ea5034018517c4a92e78ebbec85
push id79
push userfelipc@gmail.com
push dateWed, 21 Dec 2016 19:42:08 +0000
reviewersfelipe
bugs1323304
Bug 1323304 - Open the file as binary in order to let Windows read it properly when generating the hash. r=felipe
build.py
--- a/build.py
+++ b/build.py
@@ -22,17 +22,17 @@ import hashlib
 import subprocess
 
 import genshi.template
 
 this_dir = os.path.abspath(os.path.dirname(__file__))
 template_dir = os.path.join(this_dir, 'templates')
 
 def sha256(path):
-    fd = open(path)
+    fd = open(path, 'rb')
     hasher = hashlib.sha256()
     while True:
         s = fd.read(hasher.block_size)
         if not len(s):
             break
         hasher.update(s)
     return hasher.hexdigest()