diff options
Diffstat (limited to 'BaseTools/Source/Python')
-rw-r--r-- | BaseTools/Source/Python/GenFds/FfsFileStatement.py | 2 | ||||
-rw-r--r-- | BaseTools/Source/Python/GenFds/Fv.py | 2 | ||||
-rw-r--r-- | BaseTools/Source/Python/GenFds/FvImageSection.py | 4 | ||||
-rw-r--r-- | BaseTools/Source/Python/GenFds/Region.py | 4 |
4 files changed, 6 insertions, 6 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()
diff --git a/BaseTools/Source/Python/GenFds/Fv.py b/BaseTools/Source/Python/GenFds/Fv.py index 64d1709946..ab3f8b213b 100644 --- a/BaseTools/Source/Python/GenFds/Fv.py +++ b/BaseTools/Source/Python/GenFds/Fv.py @@ -182,7 +182,7 @@ class FV (FvClassObject): # Write the Fv contents to Buffer
#
if os.path.isfile(FvOutputFile):
- FvFileObj = open ( FvOutputFile,'r+b')
+ FvFileObj = open ( FvOutputFile,'rb')
GenFdsGlobalVariable.VerboseLogger( "\nGenerate %s FV Successfully" %self.UiFvName)
GenFdsGlobalVariable.SharpCounter = 0
diff --git a/BaseTools/Source/Python/GenFds/FvImageSection.py b/BaseTools/Source/Python/GenFds/FvImageSection.py index 748d02f700..5989978a7c 100644 --- a/BaseTools/Source/Python/GenFds/FvImageSection.py +++ b/BaseTools/Source/Python/GenFds/FvImageSection.py @@ -64,7 +64,7 @@ class FvImageSection(FvImageSectionClassObject): for FvFileName in FileList:
FvAlignmentValue = 0
if os.path.isfile(FvFileName):
- FvFileObj = open (FvFileName,'r+b')
+ FvFileObj = open (FvFileName,'rb')
FvFileObj.seek(0)
# PI FvHeader is 0x48 byte
FvHeaderBuffer = FvFileObj.read(0x48)
@@ -109,7 +109,7 @@ class FvImageSection(FvImageSectionClassObject): if self.FvFileName != None:
FvFileName = GenFdsGlobalVariable.ReplaceWorkspaceMacro(self.FvFileName)
if os.path.isfile(FvFileName):
- FvFileObj = open (FvFileName,'r+b')
+ FvFileObj = open (FvFileName,'rb')
FvFileObj.seek(0)
# PI FvHeader is 0x48 byte
FvHeaderBuffer = FvFileObj.read(0x48)
diff --git a/BaseTools/Source/Python/GenFds/Region.py b/BaseTools/Source/Python/GenFds/Region.py index e393286a16..945c5489fd 100644 --- a/BaseTools/Source/Python/GenFds/Region.py +++ b/BaseTools/Source/Python/GenFds/Region.py @@ -148,7 +148,7 @@ class Region(RegionClassObject): EdkLogger.error("GenFds", GENFDS_ERROR,
"Size of FV File (%s) is larger than Region Size 0x%X specified." \
% (RegionData, Size))
- BinFile = open(FileName, 'r+b')
+ BinFile = open(FileName, 'rb')
Buffer.write(BinFile.read())
BinFile.close()
Size = Size - FileLength
@@ -201,7 +201,7 @@ class Region(RegionClassObject): EdkLogger.error("GenFds", GENFDS_ERROR,
"Size 0x%X of Capsule File (%s) is larger than Region Size 0x%X specified." \
% (FileLength, RegionData, Size))
- BinFile = open(FileName, 'r+b')
+ BinFile = open(FileName, 'rb')
Buffer.write(BinFile.read())
BinFile.close()
Size = Size - FileLength
|