BaseTools: fix the open file's read and write bugs

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
This commit is contained in:
Yunhua Feng
2018-07-27 16:02:05 +08:00
committed by Yonghong Zhu
parent fe3991d635
commit a09f4c91f7
7 changed files with 38 additions and 20 deletions

View File

@ -305,7 +305,7 @@ class GenVPD :
self.PcdFixedOffsetSizeList = []
self.PcdUnknownOffsetList = []
try:
fInputfile = open(InputFileName, "r", 0)
fInputfile = open(InputFileName, "r")
try:
self.FileLinesList = fInputfile.readlines()
except:
@ -650,7 +650,7 @@ class GenVPD :
EdkLogger.error("BPDG", BuildToolError.FILE_OPEN_FAILURE, "File open failed for %s" % self.VpdFileName, None)
try :
fMapFile = open(MapFileName, "w", 0)
fMapFile = open(MapFileName, "w")
except:
# Open failed
EdkLogger.error("BPDG", BuildToolError.FILE_OPEN_FAILURE, "File open failed for %s" % self.MapFileName, None)