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=yonghong.zhu@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 3EF63210C2791 for ; Wed, 1 Aug 2018 00:03:20 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Aug 2018 00:03:19 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,431,1526367600"; d="scan'208";a="245040702" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by orsmga005.jf.intel.com with ESMTP; 01 Aug 2018 00:02:54 -0700 Received: from fmsmsx119.amr.corp.intel.com (10.18.124.207) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 1 Aug 2018 00:02:46 -0700 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by FMSMSX119.amr.corp.intel.com (10.18.124.207) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 1 Aug 2018 00:02:46 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.100]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.173]) with mapi id 14.03.0319.002; Wed, 1 Aug 2018 15:02:26 +0800 From: "Zhu, Yonghong" To: "Kinney, Michael D" , "edk2-devel@lists.01.org" CC: "Sun, Yanyan" , "Gao, Liming" , "Zhu, Yonghong" Thread-Topic: [Patch] BaseTools/BinToPcd: Fix Python 2.7.x compatibility issue Thread-Index: AQHUKOuZ0Gut+EbV0Em/8t1xEU65jKSqeOXw Date: Wed, 1 Aug 2018 07:02:26 +0000 Message-ID: References: <20180731162839.35540-1-michael.d.kinney@intel.com> In-Reply-To: <20180731162839.35540-1-michael.d.kinney@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [Patch] BaseTools/BinToPcd: Fix Python 2.7.x compatibility issue X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Aug 2018 07:03:20 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Yonghong Zhu =20 Best Regards, Zhu Yonghong -----Original Message----- From: Kinney, Michael D=20 Sent: Wednesday, August 01, 2018 12:29 AM To: edk2-devel@lists.01.org Cc: Sun, Yanyan ; Zhu, Yonghong ; Gao, Liming ; Kinney, Michael D Subject: [Patch] BaseTools/BinToPcd: Fix Python 2.7.x compatibility issue https://bugzilla.tianocore.org/show_bug.cgi?id=3D1042 Convert Buffer to type bytearray before converting to a string of hex byte = values so the type of items in Buffer is consistent for both Python 2.7.x a= nd Python 3.x. Cc: YanYan Sun Cc: Yonghong Zhu Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Michael D Kinney --- BaseTools/Scripts/BinToPcd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BaseTools/Scripts/BinToPcd.py b/BaseTools/Scripts/BinToPcd.py = index c42e37bd11..25b74f6004 100644 --- a/BaseTools/Scripts/BinToPcd.py +++ b/BaseTools/Scripts/BinToPcd.py @@ -66,7 +66,7 @@ if __name__ =3D=3D '__main__': # # If Xdr flag is not set, then concatenate all the data # - Buffer =3D b''.join (Buffer) + Buffer =3D bytearray (b''.join (Buffer)) # # Return a PCD value of the form '{0x01, 0x02, ...}' along with th= e PCD length in bytes # -- 2.14.2.windows.3