From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.20; helo=mga02.intel.com; envelope-from=jaben.carsey@intel.com; receiver=edk2-devel@lists.01.org Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) (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 EB954202E531F for ; Thu, 14 Feb 2019 07:30:32 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Feb 2019 07:30:31 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,369,1544515200"; d="scan'208";a="134298582" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga002.jf.intel.com with ESMTP; 14 Feb 2019 07:30:31 -0800 Received: from fmsmsx154.amr.corp.intel.com (10.18.116.70) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.408.0; Thu, 14 Feb 2019 07:30:31 -0800 Received: from fmsmsx103.amr.corp.intel.com ([169.254.2.115]) by FMSMSX154.amr.corp.intel.com ([169.254.6.137]) with mapi id 14.03.0415.000; Thu, 14 Feb 2019 07:30:30 -0800 From: "Carsey, Jaben" To: "Fan, ZhijuX" , "edk2-devel@lists.01.org" CC: "Gao, Liming" Thread-Topic: [PATCH] BaseTools:Function application error Thread-Index: AdTERVVcF3H0CJLdR46T3qBdTIhPdQANJ4kA Date: Thu, 14 Feb 2019 15:30:30 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYzhlOGUzYjctOTI5OC00NTgyLWJhOTYtNzA0N2I5MDIxODI1IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiS041WXNNR3pSd1JpcXlUdzM5VTkwaWVGM2ZCMFlEMjA4V012N1dHbnluQTRVaGluOFdwNXRLZXRjTE5sZFZudSJ9 x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: no-action x-originating-ip: [10.1.200.108] MIME-Version: 1.0 Subject: Re: [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 15:30:33 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable I am really confused by this patch and how it ever worked. I see that you remove the import for sdict. But I see that sdict is used i= n other places in that file. I also cant find a class definition for sdict anywhere (certainly not in Co= mmon/Misc). So maybe refactor and remove all the other uses of sdict from the file? -Jaben > -----Original Message----- > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of > Fan, ZhijuX > Sent: Thursday, February 14, 2019 1:12 AM > To: edk2-devel@lists.01.org > Cc: Gao, Liming > Subject: [edk2] [PATCH] BaseTools:Function application error >=20 > 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 >=20 > 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(-) >=20 > diff --git a/BaseTools/Source/Python/Eot/EotMain.py > b/BaseTools/Source/Python/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/BaseTools/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/Source/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_LINE_BREAK)) > + TempFile.writelines(TempList) > TempFile.close() >=20 > try: > -- > 2.14.1.windows.1 >=20 > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel