From nobody Thu May 2 22:47:32 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+66583+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+66583+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1603690811; cv=none; d=zohomail.com; s=zohoarc; b=I1Df68Qk++y/3B/ge8iE2Eenxbn+kCSim4HVwRYX3svc9ermyXryc2GpVZFRMTOnPnx/lEO4NRd1f0o7Ej43IyCJW1mKBqPlm8LH68Mrlc2ZiIztS05q+p1zQKQJGRqBAQumtldSy3eRSkjnKP+uXfhTpH+M5dXCEP8C/mnvvck= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1603690811; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=Jc1lEIMuyCVUz/aHDUyzce3AZcNFNHZoQ+8E3TrVi7M=; b=iYOP81RfgqvcZgfk5SwbLItNQyNo/w9wCXXTVosxnoyOwop99aGTuh+h2MWDGda3Z4Q/np5vIpiqX9d8HgCPLvEEpGumaB8SlrwljXJP6QohAHzmgdQcNCx5HVba64PwEK5Npnr2Fn8c6QLbw6LTu3dX/ayIcH/c6iWBw6Ek4Lo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+66583+1787277+3901457@groups.io Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 160369081154976.18837224029471; Sun, 25 Oct 2020 22:40:11 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id RieAYY1788612xvMTox6O3c9; Sun, 25 Oct 2020 22:40:11 -0700 X-Received: from mail.byosoft.com.cn (mail.byosoft.com.cn [58.240.74.242]) by mx.groups.io with SMTP id smtpd.web08.9145.1603690803942140611 for ; Sun, 25 Oct 2020 22:40:05 -0700 X-Received: from LAPTOP2AECFQIA ([58.246.60.130]) (envelope-sender ) by 192.168.6.13 with ESMTP for ; Mon, 26 Oct 2020 13:39:55 +0800 X-WM-Sender: fengyunhua@byosoft.com.cn X-WM-AuthFlag: YES X-WM-AuthUser: fengyunhua@byosoft.com.cn From: "fengyunhua" To: , Cc: "'Bob Feng'" , "'Liming Gao'" , "'Yuwei Chen'" References: <20201023030142.2015-1-mingyuex.liang@intel.com> In-Reply-To: <20201023030142.2015-1-mingyuex.liang@intel.com> Subject: =?UTF-8?B?5Zue5aSNOiBbZWRrMi1kZXZlbF0gW1BBVENIXSBCYXNlVG9vbHM6IHJlcGxhY2UgYXJyYXkuZnJvbXN0cmluZyBNZXRob2QgZm9yIHN1cHBvcnRzIHB5LTIgYW5kIHB5LTMu?= Date: Mon, 26 Oct 2020 13:40:00 +0800 Message-ID: <000001d6ab5a$72ab8ce0$5802a6a0$@byosoft.com.cn> MIME-Version: 1.0 Thread-Index: AQK5Qvxi+ysv896Io6SpqbivPkS6aqfkLOrw Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,fengyunhua@byosoft.com.cn X-Gm-Message-State: ZPSuAKAn86GfXcBY3uyD0wqnx1787277AA= Content-Transfer-Encoding: quoted-printable Content-Language: zh-cn DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1603690811; bh=Mbv0JbnyoMtmYZFVSu6WXvWGuimRJEJ61bAIXpr6y1Q=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=CvK5SxqmVE5X+gygcZXhYEBzJIF0rTIhO8kIq7I7PR/M3Z80nGQFnVVhoIvPW06FrD+ eFz3+E7zlcNG42bAFQfMAStVnx16fHQE0zSEj/vi7EuKBGFg38+ynrkTvP7R6kAjKF0A1 1aVvHUeiA7cuBqICb+EL0Gw3ol6J13I8V8Q= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" Array.tostring also should replace -----=E9=82=AE=E4=BB=B6=E5=8E=9F=E4=BB=B6----- =E5=8F=91=E4=BB=B6=E4=BA=BA: bounce+27952+66563+5049190+8953120@groups.io <= bounce+27952+66563+5049190+8953120@groups.io> =E4=BB=A3=E8=A1=A8 mliang2x =E5=8F=91=E9=80=81=E6=97=B6=E9=97=B4: 2020=E5=B9=B410=E6=9C=8823=E6=97=A5 1= 1:02 =E6=94=B6=E4=BB=B6=E4=BA=BA: devel@edk2.groups.io =E6=8A=84=E9=80=81: Mingyue Liang ; Bob Feng ; Liming Gao ; Yuwei Chen =E4=B8=BB=E9=A2=98: [edk2-devel] [PATCH] BaseTools: replace array.fromstrin= g Method for supports py-2 and py-3. Because after Python 3.2, array.fromstring method is renamed frombytes, so it needs to be modified to support python2 and python3 methods. Signed-off-by: Mingyue Liang Cc: Bob Feng Cc: Liming Gao Cc: Yuwei Chen --- BaseTools/Source/Python/Eot/EotMain.py | 8 ++++---- BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/BaseTools/Source/Python/Eot/EotMain.py b/BaseTools/Source/Pyth= on/Eot/EotMain.py index 791fcdfeae..2ff68054e6 100644 --- a/BaseTools/Source/Python/Eot/EotMain.py +++ b/BaseTools/Source/Python/Eot/EotMain.py @@ -152,11 +152,11 @@ class CompressedImage(Image): try: TmpData =3D DeCompress('Efi', self[self._HEADER_SIZE_:]) DecData =3D array('B') - DecData.fromstring(TmpData) + list(map(lambda str: DecData.fromlist([ord(str), 0]), TmpData)) except: TmpData =3D DeCompress('Framework', self[self._HEADER_SIZE_:]) DecData =3D array('B') - DecData.fromstring(TmpData) + list(map(lambda str: DecData.fromlist([ord(str), 0]), TmpData)) =20 SectionList =3D [] Offset =3D 0 @@ -738,7 +738,7 @@ class GuidDefinedImage(Image): Offset =3D self.DataOffset - 4 TmpData =3D DeCompress('Framework', self[self.Offset:]) DecData =3D array('B') - DecData.fromstring(TmpData) + list(map(lambda str: DecData.fromlist([ord(str), 0]), TmpD= ata)) Offset =3D 0 while Offset < len(DecData): Sec =3D Section() @@ -759,7 +759,7 @@ class GuidDefinedImage(Image): =20 TmpData =3D DeCompress('Lzma', self[self.Offset:]) DecData =3D array('B') - DecData.fromstring(TmpData) + list(map(lambda str: DecData.fromlist([ord(str), 0]), TmpD= ata)) Offset =3D 0 while Offset < len(DecData): Sec =3D Section() diff --git a/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py b/BaseT= ools/Source/Python/GenFds/GenFdsGlobalVariable.py index dc1727c466..411af80c2b 100644 --- a/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py +++ b/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py @@ -463,7 +463,7 @@ class GenFdsGlobalVariable: GenFdsGlobalVariable.SecCmdList.append(' '.join(Cmd).s= trip()) else: SectionData =3D array('B', [0, 0, 0, 0]) - SectionData.fromstring(Ui.encode("utf_16_le")) + list(map(lambda str: SectionData.fromlist([ord(str), 0]), = Ui)) SectionData.append(0) SectionData.append(0) Len =3D len(SectionData) --=20 2.28.0.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#66583): https://edk2.groups.io/g/devel/message/66583 Mute This Topic: https://groups.io/mt/77809034/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-