From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.136; helo=mga12.intel.com; envelope-from=zhijux.fan@intel.com; receiver=edk2-devel@lists.01.org Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id B823A201B0412 for ; Thu, 14 Feb 2019 01:12:02 -0800 (PST) X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Feb 2019 01:12:01 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,368,1544515200"; d="dat'59?scan'59,208,59";a="318933550" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by fmsmga006.fm.intel.com with ESMTP; 14 Feb 2019 01:12:00 -0800 Received: from fmsmsx152.amr.corp.intel.com (10.18.125.5) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.408.0; Thu, 14 Feb 2019 01:12:01 -0800 Received: from shsmsx153.ccr.corp.intel.com (10.239.6.53) by FMSMSX152.amr.corp.intel.com (10.18.125.5) with Microsoft SMTP Server (TLS) id 14.3.408.0; Thu, 14 Feb 2019 01:12:00 -0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.110]) by SHSMSX153.ccr.corp.intel.com ([169.254.12.190]) with mapi id 14.03.0415.000; Thu, 14 Feb 2019 17:11:58 +0800 From: "Fan, ZhijuX" To: "edk2-devel@lists.01.org" CC: "Gao, Liming" , "Feng, Bob C" Thread-Topic: [PATCH] BaseTools:Function application error Thread-Index: AdTERVVcF3H0CJLdR46T3qBdTIhPdQ== Date: Thu, 14 Feb 2019 09:11:58 +0000 Message-ID: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 X-Content-Filtered-By: Mailman/MimeDel 2.1.29 Subject: [PATCH] BaseTools:Function application error X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Feb 2019 09:12:02 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Error due to incorrect function parameters and attributes FileWrite() The first argument it needs is a list, not a file This patch abandons this function and saves the file independently Cc: Bob Feng Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Zhiju.Fan --- BaseTools/Source/Python/Eot/EotMain.py | 5 +++-- BaseTools/Source/Python/Workspace/BuildClassObject.py | 1 + BaseTools/Source/Python/build/BuildReport.py | 9 ++++++--- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/BaseTools/Source/Python/Eot/EotMain.py b/BaseTools/Source/Pyth= on/Eot/EotMain.py index fd4bee6f90..8c2bfc45e4 100644 --- a/BaseTools/Source/Python/Eot/EotMain.py +++ b/BaseTools/Source/Python/Eot/EotMain.py @@ -21,7 +21,7 @@ import Eot.EotGlobalData as EotGlobalData from optparse import OptionParser from Common.StringUtils import NormPath from Common import BuildToolError -from Common.Misc import GuidStructureStringToGuidString, sdict +from Common.Misc import GuidStructureStringToGuidString from Eot.Parser import * from Eot.InfParserLite import EdkInfParser from Common.StringUtils import GetSplitValueList @@ -32,6 +32,7 @@ from Eot.Report import Report from Common.BuildVersion import gBUILD_VERSION from Eot.Parser import ConvertGuid from Common.LongFilePathSupport import OpenLongFilePath as open +import collections import struct import uuid import copy @@ -57,7 +58,7 @@ class Image(array): self._LEN_ =3D None self._OFF_ =3D None =20 - self._SubImages =3D sdict() # {offset: Image()} + self._SubImages =3D collections.OrderedDict() # {offset: Image()} =20 array.__init__(self) =20 diff --git a/BaseTools/Source/Python/Workspace/BuildClassObject.py b/BaseTo= ols/Source/Python/Workspace/BuildClassObject.py index cff77a71ae..6f8a09e87c 100644 --- a/BaseTools/Source/Python/Workspace/BuildClassObject.py +++ b/BaseTools/Source/Python/Workspace/BuildClassObject.py @@ -261,6 +261,7 @@ class StructurePcd(PcdClassObject): self.PackageDecs =3D Packages self.DefaultStoreName =3D [default_store] self.DefaultValues =3D OrderedDict() + self.DefaultFromDSC =3D None self.PcdMode =3D None self.SkuOverrideValues =3D OrderedDict() self.StructName =3D None diff --git a/BaseTools/Source/Python/build/BuildReport.py b/BaseTools/Sourc= e/Python/build/BuildReport.py index 0b98d62cb6..70584570a5 100644 --- a/BaseTools/Source/Python/build/BuildReport.py +++ b/BaseTools/Source/Python/build/BuildReport.py @@ -1651,14 +1651,17 @@ class PredictionReport(object): SourceList =3D os.path.join(self._EotDir, "SourceFile.txt") GuidList =3D os.path.join(self._EotDir, "GuidList.txt") DispatchList =3D os.path.join(self._EotDir, "Dispatch.txt") - + TempList =3D [] TempFile =3D open(SourceList, "w+") for Item in self._SourceList: - FileWrite(TempFile, Item) + TempList.append(Item + TAB_LINE_BREAK) + TempFile.writelines(TempList) TempFile.close() + TempList =3D [] TempFile =3D open(GuidList, "w+") for Key in self._GuidMap: - FileWrite(TempFile, "%s %s" % (Key, self._GuidMap[Key])) + TempList.append("%s %s %s" % (Key, self._GuidMap[Key], TAB_LIN= E_BREAK)) + TempFile.writelines(TempList) TempFile.close() =20 try: --=20 2.14.1.windows.1