From f8db6527da8678f1480f08ba99b745279e8d104a Mon Sep 17 00:00:00 2001 From: Yonghong Zhu Date: Wed, 14 Sep 2016 13:59:01 +0800 Subject: 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 Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yonghong Zhu Reviewed-by: Liming Gao --- BaseTools/Source/Python/GenFds/FfsFileStatement.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'BaseTools/Source/Python/GenFds/FfsFileStatement.py') 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() -- cgit v1.2.3