From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mx.groups.io with SMTP id smtpd.web11.160.1597277804333381178 for ; Wed, 12 Aug 2020 17:16:44 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=Jvgn41TM; spf=pass (domain: intel.com, ip: 134.134.136.20, mailfrom: yuwei.chen@intel.com) IronPort-SDR: 5SwKrZQSWFpH6h9UZGEpKWqs3bQ0qhFG8Npky0vPagQpyHWz8oqnASci/k9EZGa1TOMTcqUiA8 7AI8WtbV45UA== X-IronPort-AV: E=McAfee;i="6000,8403,9711"; a="141959103" X-IronPort-AV: E=Sophos;i="5.76,306,1592895600"; d="scan'208";a="141959103" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Aug 2020 17:16:43 -0700 IronPort-SDR: mxi2npEOpKts20EzUGvKfTfkrsN5b/B1NuGB9GgvWXebDbp8So7R5MX6wYWJR+Lel0Gx9dnye1 SQ+kHEzyiaPA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,306,1592895600"; d="scan'208";a="369433275" Received: from unknown (HELO fmsmsx604.amr.corp.intel.com) ([10.18.84.214]) by orsmga001.jf.intel.com with ESMTP; 12 Aug 2020 17:16:43 -0700 Received: from fmsmsx604.amr.corp.intel.com (10.18.126.84) by fmsmsx604.amr.corp.intel.com (10.18.126.84) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Wed, 12 Aug 2020 17:16:43 -0700 Received: from fmsmsx102.amr.corp.intel.com (10.18.124.200) by fmsmsx604.amr.corp.intel.com (10.18.126.84) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1713.5 via Frontend Transport; Wed, 12 Aug 2020 17:16:43 -0700 Received: from FMSEDG001.ED.cps.intel.com (10.1.192.133) by FMSMSX102.amr.corp.intel.com (10.18.124.200) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 12 Aug 2020 17:16:42 -0700 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.170) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 12 Aug 2020 17:16:42 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=P8OHgbFplC5IbBZ6F1LmYnw5bLsjhxHbiggZZHDiS9LFISmTjoxk2RdbclJ2LDcYfzxTj06DLsVhyNg5u1ohyCMSAT99mOFjBdqCp2oA8tlJDnQyG55J4s4i2l4nn4HmZn8fBbAE85yb1780FCA0QK/KT2uw4BynYWBBQf9vmulkEHMa9juQXTnqiq/X7OMVWBGgwXl6JympNja4FbeER/P658iQ9OPdmA+L8vqcV5XR1bk1RSZw/3u/6MOeTfj2erX3SthS5shQ+AfxXF31xZ7ufD44e6pIfjEbe1/fSmoz5bp6JB/vSqVeJXXVfn/m06vydniw9M0gPyJ6sMBC/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=1MmFXdXDRX8DvHixyfRbpB+1/LIUWGerbUFus0ZzM8g=; b=nkaP2vqAzvKEGupO1JEPkWgMyEWXbCrLdR7oQoI5CsxtMImulsD77RIwxG4A9TKWFSQRPKvDh7+ecHCFyWDNZ5hXp3Ub50DdiQHD9lZ3d7TZx88l6hxb/R0fITuZ/Pgk+z7Z9ZaCjjpTKd0pdzmR/DOMY07MhdleDAz3ZnwmhEQh+CgEZC483KhXmt70dMhsTG1TkxpeJ3FVQZfnMX//mqGUu7fABy4SJiFwGHd8G8s+Mhgd1wmLL1Sf5aksUJTrAZ6b1zqMDMACop6dXpuRvw/mLTk2ZFRSgfGvEmABa7m6ZRiEX6717cbs9r8crkTgekIj58jaWaTrjL7RAXmSxg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=1MmFXdXDRX8DvHixyfRbpB+1/LIUWGerbUFus0ZzM8g=; b=Jvgn41TMrBLncPmdEN36nyvxnS/cUhwWSjf524XLLClYsARjFpOlw4eL7NFvw7wsayMheK/OhrypkPwoOXvE6T3pfxaNrI3y9rV0ntp+d3gk4mp0+P/mtRX1l0UMCr0aVF5r5r1PHIte7t9MeUL/+gHmISwXOnjSTwruFQGL6gw= Received: from DM5PR11MB1594.namprd11.prod.outlook.com (10.172.34.144) by DM6PR11MB4738.namprd11.prod.outlook.com (20.180.252.210) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3283.16; Thu, 13 Aug 2020 00:16:41 +0000 Received: from DM5PR11MB1594.namprd11.prod.outlook.com ([fe80::503:d97b:c650:831d]) by DM5PR11MB1594.namprd11.prod.outlook.com ([fe80::503:d97b:c650:831d%12]) with mapi id 15.20.3283.015; Thu, 13 Aug 2020 00:16:41 +0000 From: "Yuwei Chen" To: "devel@edk2.groups.io" , "crobinso@redhat.com" CC: "Feng, Bob C" , "Gao, Liming" Subject: Re: [edk2-devel] [PATCH 2/2] BaseTools: Work around array.array.tostring() removal in python 3.9 Thread-Topic: [edk2-devel] [PATCH 2/2] BaseTools: Work around array.array.tostring() removal in python 3.9 Thread-Index: AQHWcAdHKCTK5gswV0um/w689/4EDqk1LfEg Date: Thu, 13 Aug 2020 00:16:40 +0000 Message-ID: References: <95d3490d62f9d320e61efa10cba7424a6f626f66.1597166808.git.crobinso@redhat.com> In-Reply-To: <95d3490d62f9d320e61efa10cba7424a6f626f66.1597166808.git.crobinso@redhat.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-version: 11.5.1.3 dlp-reaction: no-action dlp-product: dlpe-windows authentication-results: edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=none action=none header.from=intel.com; x-originating-ip: [192.102.204.38] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: fb0e3fae-bbb3-43f2-cd14-08d83f1e2725 x-ms-traffictypediagnostic: DM6PR11MB4738: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:469; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 9pE1LKZGGaFhv5uYnXou01JIw/9ODf4HSlX4u/EAIfwSL9jl4GqAeE4tODiiiMNCQkaYw/H7dbvIqtr6vtcZrXFpXytZCe9xe0e29wzkFdGq340KJofmkBtA8vjt9zf5QGVIddXO9Z0Vw4aNt1HeMg2uFCToLe+blJtg801dvFYYSHTR5hhbV0p166TQ6gocJNtb7Dg24/vY1HciD//tWljAmNLsRHIpHaIyYtGOmQEtHo5FH79Ca8r/iq/APqy+0LAt7dnL804wNvqEv4u7vy1JcjCJFVuK9sI6Xpk3nDTRLB8Kl47C2PicjRSoiZvTnp/OhHR6kzdizsI9aOnOJIK+LGIuudcMTwkYK3eKDWp4/p/owWudch39XbFyQgFZG05wb7+qxos6r4gWiroiQA== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM5PR11MB1594.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(376002)(39860400002)(136003)(346002)(366004)(396003)(966005)(186003)(478600001)(2906002)(86362001)(7696005)(6506007)(26005)(53546011)(83380400001)(8676002)(33656002)(54906003)(71200400001)(64756008)(66446008)(66476007)(76116006)(66946007)(107886003)(66556008)(9686003)(55016002)(5660300002)(52536014)(316002)(110136005)(8936002)(4326008);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: cTLvqnfM5XuBUSc3hkYtzI27w/zY5aOD/up1WawWpUF+wbTg05q/Q6KrAPER0BJ+mDfE2qPKSWe9OQFBbhHkio6QGlRPxa8YvzmyMFkcUPxQ78JEG8r/sZ+mF45lXgegWYtPHlCKpAzHtJZzFIrBSGOGUrStNYgcqU6ezrBeJDsTn1gN60hXZmH8vDkMBAIUKQk1ne0M8PeP6bduIOzBQl9m6nnRyWufulvUxNrUyG1zc+tDI226hMx1NKEboo2k9WKAeHSBJsOJvlojiY0dOm5mKrP6qYPSBaPlUC2ZP7x2LNnymcfbRjU0Mld67gDPTjLaqkfZ9e37ePVatljeAQXrElBvhTAxSKFdPwnoTkNS5p+RC5VRSTj8onxOVZIrb9eTz+qCyG9Iq3BOBcubUrBjsmJckWOUtf246NyH6JIDdNdvQboAamZ7hDAuLZah13eQFKFAiXTmserIByOSDkH53ZtZKRrVeTh0+TeW0OKugA1kYV6umL8TG0lW9/zYhkFpeedOPl661O1ALjeWIDl1AkmXmNBRJfAbj8C1oMfq9oVp5wOowkxU+HwxDRYLmKNUYePUu5d8ACikRbjVenfxF6mSZbcN+cvURWe2tL6IClY6GCxcjlBxrp++dYqpKG82CfSxfDuW9OIFBpAu/Q== MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM5PR11MB1594.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: fb0e3fae-bbb3-43f2-cd14-08d83f1e2725 X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Aug 2020 00:16:40.9943 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: CkhtuD3mEMgzmQRtnhSTl8Mgk1CPYp4/jL/UmNzdOGYnrl3l77HZkqmQ0JpeNYjdIGOju0tv7o4Kg7B743uNgg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB4738 Return-Path: yuwei.chen@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Yuwei Chen > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of Cole > Sent: Wednesday, August 12, 2020 1:28 AM > To: devel@edk2.groups.io > Cc: Feng, Bob C ; Gao, Liming > ; Cole Robinson > Subject: [edk2-devel] [PATCH 2/2] BaseTools: Work around > array.array.tostring() removal in python 3.9 >=20 > In python3, array.array.tostring() was a compat alias for tobytes(). > tostring() was removed in python 3.9. >=20 > Convert this to use tolist() which should be valid for all python versio= ns. >=20 > This fixes this build error on python3.9: >=20 > (Python 3.9.0b5 on linux) Traceback (most recent call last): > File "/root/edk2/edk2-edk2- > stable202002/BaseTools/BinWrappers/PosixLike/../../Source/Python/Trim/Tr > im.py", line 593, in Main > GenerateVfrBinSec(CommandOptions.ModuleName, > CommandOptions.DebugDir, CommandOptions.OutputFile) > File "/root/edk2/edk2-edk2- > stable202002/BaseTools/BinWrappers/PosixLike/../../Source/Python/Trim/Tr > im.py", line 449, in GenerateVfrBinSec > VfrUniOffsetList =3D GetVariableOffset(MapFileName, EfiFileName, > VfrNameList) > File "/root/edk2/edk2-edk2- > stable202002/BaseTools/Source/Python/Common/Misc.py", line 88, in > GetVariableOffset > return _parseForGCC(lines, efifilepath, varnames) > File "/root/edk2/edk2-edk2- > stable202002/BaseTools/Source/Python/Common/Misc.py", line 151, in > _parseForGCC > efisecs =3D PeImageClass(efifilepath).SectionHeaderList > File "/root/edk2/edk2-edk2- > stable202002/BaseTools/Source/Python/Common/Misc.py", line 1638, in > __init__ > if ByteArray.tostring() !=3D b'PE\0\0': > AttributeError: 'array.array' object has no attribute 'tostring' >=20 > Signed-off-by: Cole Robinson > --- > BaseTools/Source/Python/Common/Misc.py | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > diff --git a/BaseTools/Source/Python/Common/Misc.py > b/BaseTools/Source/Python/Common/Misc.py > index ad55671080..4be7957138 100755 > --- a/BaseTools/Source/Python/Common/Misc.py > +++ b/BaseTools/Source/Python/Common/Misc.py > @@ -1635,7 +1635,7 @@ class PeImageClass(): > ByteArray =3D array.array('B') > ByteArray.fromfile(PeObject, 4) > # PE signature should be 'PE\0\0' > - if ByteArray.tostring() !=3D b'PE\0\0': > + if ByteArray.tolist() !=3D [ord('P'), ord('E'), 0, 0]: > self.ErrorInfo =3D self.FileName + ' has no valid PE signat= ure PE00' > return >=20 > -- > 2.26.2 >=20 >=20 >=20