Bug 633423 - Checksum generation (build/checksums.py) needs to open files in binary mode for correct checksums, r=khuey f=nthomas a=beltzner
authorJustin Wood <Callek@gmail.com>
Fri, 11 Feb 2011 12:06:30 -0500
changeset 62358 da205ca44184423469d158c3d5e0d41d4b6e70e7
parent 62357 47cbe0ba759c977963944bcbd5529ff7ece71592
child 62359 b57524d6706fb12b93479c2692942fedab500ec0
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskhuey, beltzner
bugs633423
milestone2.0b12pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 633423 - Checksum generation (build/checksums.py) needs to open files in binary mode for correct checksums, r=khuey f=nthomas a=beltzner
build/checksums.py
--- a/build/checksums.py
+++ b/build/checksums.py
@@ -52,17 +52,17 @@ def digest_file(filename, digest, chunk_
     work, the None object will be returned instead.  The size of blocks
     that this function will read from the file object it opens based on
     'filename' can be specified by 'chunk_size', which defaults to 1K'''
     assert not os.path.isdir(filename), 'this function only works with files'
     logger = logging.getLogger('checksums.py')
     if hashlib is not None:
         logger.debug('Creating new %s object' % digest)
         h = hashlib.new(digest)
-        f = open(filename)
+        f = open(filename, "rb")
         while True:
             data = f.read(chunk_size)
             if not data:
                 logger.debug('Finished reading in file')
                 break
             h.update(data)
         f.close()
         hash = h.hexdigest()