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 A514F20886FE2 for ; Thu, 14 Feb 2019 16:59:10 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Feb 2019 16:59:09 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,370,1544515200"; d="scan'208";a="147000824" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by fmsmga001.fm.intel.com with ESMTP; 14 Feb 2019 16:59:09 -0800 Received: from fmsmsx125.amr.corp.intel.com (10.18.125.40) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.408.0; Thu, 14 Feb 2019 16:59:09 -0800 Received: from shsmsx107.ccr.corp.intel.com (10.239.4.96) by FMSMSX125.amr.corp.intel.com (10.18.125.40) with Microsoft SMTP Server (TLS) id 14.3.408.0; Thu, 14 Feb 2019 16:59:09 -0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.110]) by SHSMSX107.ccr.corp.intel.com ([169.254.9.162]) with mapi id 14.03.0415.000; Fri, 15 Feb 2019 08:59:07 +0800 From: "Fan, ZhijuX" To: "Carsey, Jaben" , "edk2-devel@lists.01.org" CC: "Gao, Liming" Thread-Topic: [PATCH] BaseTools:Function application error Thread-Index: AdTERVVcF3H0CJLdR46T3qBdTIhPdQANJ4kAABL/yuA= Date: Fri, 15 Feb 2019 00:59:06 +0000 Message-ID: References: In-Reply-To: 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 Subject: FW: [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: Fri, 15 Feb 2019 00:59:10 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable The sdict() was originally defined as common/Misc.py and UPT/library/Misc.p= y. However, the sdict() defined previously in common/Misc.py has been removed. It is not as good as the OrderedDict() when running in Python3. Any question, please let me know. Thanks. Best Regards Fan Zhiju -----Original Message----- From: Carsey, Jaben=20 Sent: Thursday, February 14, 2019 11:31 PM To: Fan, ZhijuX ; edk2-devel@lists.01.org Cc: Gao, Liming Subject: RE: [PATCH] BaseTools:Function application error 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=20 > 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=20 > 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=20 > optparse import OptionParser from Common.StringUtils import NormPath =20 > from Common import BuildToolError -from Common.Misc import=20 > GuidStructureStringToGuidString, sdict > +from Common.Misc import GuidStructureStringToGuidString > from Eot.Parser import * > from Eot.InfParserLite import EdkInfParser from Common.StringUtils=20 > import GetSplitValueList @@ -32,6 +32,7 @@ from Eot.Report import=20 > Report from Common.BuildVersion import gBUILD_VERSION from=20 > Eot.Parser import ConvertGuid from Common.LongFilePathSupport import=20 > 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:=20 > + 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