From 8362a3f3fc9fc71a384b1ad98be89a736cdbacbc Mon Sep 17 00:00:00 2001
From: Patrick Daly <pdaly@codeaurora.org>
Date: Fri, 15 Jul 2016 16:42:53 -0700
Subject: [PATCH] lrdp-v2: Use 'rb' mode when opening DDR files

Calling read_byte() on windows may return the empty string '' prior
to the end of the file without opening the file in 'rb' mode.

The 'rb' mode was removed by
commit 5743b613351b7f72211f6b35afdc979def99e018
("lrdp-v2: ramdump: Fix autoparse for some targets.")

Change-Id: Ibea608112400c06a9adc6f1fd3b4842a87717846
---
 linux-ramdump-parser-v2/ramdump.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/linux-ramdump-parser-v2/ramdump.py b/linux-ramdump-parser-v2/ramdump.py
index a840705..1d45dd1 100755
--- a/linux-ramdump-parser-v2/ramdump.py
+++ b/linux-ramdump-parser-v2/ramdump.py
@@ -67,7 +67,7 @@ class AutoDumpInfo(object):
         for (filename, base_addr) in self._parse():
             fullpath = os.path.join(self.autodumpdir, filename)
             end = base_addr + os.path.getsize(fullpath) - 1
-            self.ebi_files.append((open(fullpath), base_addr, end, filename))
+            self.ebi_files.append((open(fullpath, 'rb'), base_addr, end, filename))
             # sort by addr, DDR files first. The goal is for
             # self.ebi_files[0] to be the DDR file with the lowest address.
             self.ebi_files.sort(key=lambda x: (x[-1] not in DDR_FILE_NAMES,
-- 
GitLab