summaryrefslogtreecommitdiffstats
path: root/BaseTools/Source/Python/GenFds/FfsFileStatement.py
diff options
context:
space:
mode:
authorYonghong Zhu <yonghong.zhu@intel.com>2016-09-14 13:59:01 +0800
committerYonghong Zhu <yonghong.zhu@intel.com>2016-09-15 16:09:38 +0800
commitf8db6527da8678f1480f08ba99b745279e8d104a (patch)
treeb293d41e13924955af832bf602348e93023bdf1f /BaseTools/Source/Python/GenFds/FfsFileStatement.py
parent04b1d73a0dac00f5a394db89f928a18a6ce5ec15 (diff)
downloadedk2-f8db6527da8678f1480f08ba99b745279e8d104a.tar.gz
edk2-f8db6527da8678f1480f08ba99b745279e8d104a.tar.bz2
edk2-f8db6527da8678f1480f08ba99b745279e8d104a.zip
BaseTools: Fix the bug to handle the read-only file
change the 'r+b' to 'rb' for some file's open, since these files we only read it and no need to write. It can fix the bug that the file's attribute had been set to read-only. Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
Diffstat (limited to 'BaseTools/Source/Python/GenFds/FfsFileStatement.py')
-rw-r--r--BaseTools/Source/Python/GenFds/FfsFileStatement.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/BaseTools/Source/Python/GenFds/FfsFileStatement.py b/BaseTools/Source/Python/GenFds/FfsFileStatement.py
index 690826bcb9..f76ddf4d95 100644
--- a/BaseTools/Source/Python/GenFds/FfsFileStatement.py
+++ b/BaseTools/Source/Python/GenFds/FfsFileStatement.py
@@ -101,7 +101,7 @@ class FileStatement (FileStatementClassObject) :
MaxAlignValue = 1
for Index, File in enumerate(self.FileName):
try:
- f = open(File, 'r+b')
+ f = open(File, 'rb')
except:
GenFdsGlobalVariable.ErrorLogger("Error opening RAW file %s." % (File))
Content = f.read()