diff options
Diffstat (limited to 'BaseTools/Source/Python/build')
-rw-r--r-- | BaseTools/Source/Python/build/BuildReport.py | 10 | ||||
-rw-r--r-- | BaseTools/Source/Python/build/build.py | 12 |
2 files changed, 11 insertions, 11 deletions
diff --git a/BaseTools/Source/Python/build/BuildReport.py b/BaseTools/Source/Python/build/BuildReport.py index 33cc9db735..765aa5dbc6 100644 --- a/BaseTools/Source/Python/build/BuildReport.py +++ b/BaseTools/Source/Python/build/BuildReport.py @@ -28,7 +28,7 @@ import hashlib import subprocess
import threading
from datetime import datetime
-from io import BytesIO
+from io import StringIO
from Common import EdkLogger
from Common.Misc import SaveFileOnChange
from Common.Misc import GuidStructureByteArrayToGuidString
@@ -641,7 +641,7 @@ class ModuleReport(object): Match = gTimeStampPattern.search(FileContents)
if Match:
- self.BuildTimeStamp = datetime.fromtimestamp(int(Match.group(1)))
+ self.BuildTimeStamp = datetime.utcfromtimestamp(int(Match.group(1)))
except IOError:
EdkLogger.warn(None, "Fail to read report file", FwReportFileName)
@@ -726,8 +726,8 @@ def ReadMessage(From, To, ExitFlag): # read one line a time
Line = From.readline()
# empty string means "end"
- if Line is not None and Line != "":
- To(Line.rstrip())
+ if Line is not None and Line != b"":
+ To(Line.rstrip().decode(encoding='utf-8', errors='ignore'))
else:
break
if ExitFlag.isSet():
@@ -2246,7 +2246,7 @@ class BuildReport(object): def GenerateReport(self, BuildDuration, AutoGenTime, MakeTime, GenFdsTime):
if self.ReportFile:
try:
- File = BytesIO('')
+ File = StringIO('')
for (Wa, MaList) in self.ReportList:
PlatformReport(Wa, MaList, self.ReportType).GenerateReport(File, BuildDuration, AutoGenTime, MakeTime, GenFdsTime, self.ReportType)
Content = FileLinesSplit(File.getvalue(), gLineMaxLength)
diff --git a/BaseTools/Source/Python/build/build.py b/BaseTools/Source/Python/build/build.py index 2629d6046d..8208636556 100644 --- a/BaseTools/Source/Python/build/build.py +++ b/BaseTools/Source/Python/build/build.py @@ -18,7 +18,7 @@ #
import Common.LongFilePathOs as os
import re
-from io import BytesIO
+from io import StringIO
import sys
import glob
import time
@@ -242,8 +242,8 @@ def ReadMessage(From, To, ExitFlag): # read one line a time
Line = From.readline()
# empty string means "end"
- if Line is not None and Line != "":
- To(Line.rstrip())
+ if Line is not None and Line != b"":
+ To(Line.rstrip().decode(encoding='utf-8', errors='ignore'))
else:
break
if ExitFlag.isSet():
@@ -1780,7 +1780,7 @@ class Build(): if not Ma.IsLibrary:
ModuleList[Ma.Guid.upper()] = Ma
- MapBuffer = BytesIO('')
+ MapBuffer = StringIO('')
if self.LoadFixAddress != 0:
#
# Rebase module to the preferred memory address before GenFds
@@ -1938,7 +1938,7 @@ class Build(): if not Ma.IsLibrary:
ModuleList[Ma.Guid.upper()] = Ma
- MapBuffer = BytesIO('')
+ MapBuffer = StringIO('')
if self.LoadFixAddress != 0:
#
# Rebase module to the preferred memory address before GenFds
@@ -2125,7 +2125,7 @@ class Build(): #
# Rebase module to the preferred memory address before GenFds
#
- MapBuffer = BytesIO('')
+ MapBuffer = StringIO('')
if self.LoadFixAddress != 0:
self._CollectModuleMapBuffer(MapBuffer, ModuleList)
|