From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.byosoft.com.cn (mail.byosoft.com.cn [58.240.74.242]) by mx.groups.io with SMTP id smtpd.web08.1489.1610096769003720054 for ; Fri, 08 Jan 2021 01:06:09 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=none, err=permanent DNS error (domain: byosoft.com.cn, ip: 58.240.74.242, mailfrom: gaoliming@byosoft.com.cn) Received: from DESKTOPS6D0PVI ([58.246.60.130]) (envelope-sender ) by 192.168.6.13 with ESMTP for ; Fri, 08 Jan 2021 17:06:02 +0800 X-WM-Sender: gaoliming@byosoft.com.cn X-WM-AuthFlag: YES X-WM-AuthUser: gaoliming@byosoft.com.cn From: "gaoliming" To: , , , "'Liang, MingyueX'" Cc: "'Chen, Christine'" References: <20201113060406.379-1-mingyuex.liang@intel.com> In-Reply-To: Subject: =?UTF-8?B?5Zue5aSNOiBbZWRrMi1kZXZlbF0gW1BBVENIIDEvMV0gQmFzZVRvb2xzOiByZXBsYWNlIGZyb21zdHJpbmcgYW5kIHRvc3RyaW5nIE1ldGhvZC4=?= Date: Fri, 8 Jan 2021 17:06:07 +0800 Message-ID: <005201d6e59d$801c68e0$80553aa0$@byosoft.com.cn> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQGmZ4HRZV5XKbuDq2XdsIcMSL4biQJjC51xAiXPuzWqWiT5kA== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Language: zh-cn Laszlo: Bob updated the patch and merged it. https://github.com/tianocore/edk2/p= ull/1296 Thanks Liming > -----=E9=82=AE=E4=BB=B6=E5=8E=9F=E4=BB=B6----- > =E5=8F=91=E4=BB=B6=E4=BA=BA: bounce+27952+69917+4905953+8761045@groups.i= o > =E4=BB=A3=E8=A1=A8 Laszlo= Ersek > =E5=8F=91=E9=80=81=E6=97=B6=E9=97=B4: 2021=E5=B9=B41=E6=9C=887=E6=97=A5 = 20:08 > =E6=94=B6=E4=BB=B6=E4=BA=BA: devel@edk2.groups.io; bob.c.feng@intel.com;= Liang, MingyueX > > =E6=8A=84=E9=80=81: Liming Gao ; Chen, Christi= ne > > =E4=B8=BB=E9=A2=98: Re: [edk2-devel] [PATCH 1/1] BaseTools: replace from= string and tostring > Method. >=20 > On 12/22/20 03:06, Bob Feng wrote: > > Reviewed-by: Bob Feng >=20 > Has this patch been merged? >=20 > Thanks > Laszlo >=20 > > -----Original Message----- > > From: Mingyue Liang > > Sent: Friday, November 13, 2020 2:04 PM > > To: devel@edk2.groups.io > > Cc: Feng, Bob C ; Liming Gao > ; Chen, Christine > > Subject: [PATCH 1/1] BaseTools: replace fromstring and tostring Method= . > > > > Because after Python 3.2, array.tostring and array.fromstring method i= s > renamed tobytes and frombytes,so it needs to be modified to support pyth= on2 > and python3 methods. > > > > Signed-off-by: Mingyue Liang > > Cc: Bob Feng > > Cc: Liming Gao > > Cc: Yuwei Chen > > Cc: Mingyue Liang > > --- > > BaseTools/Source/Python/Eot/EotMain.py | 10 > +++++----- > > BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py | 4 ++-- > > 2 files changed, 7 insertions(+), 7 deletions(-) > > > > diff --git a/BaseTools/Source/Python/Eot/EotMain.py > b/BaseTools/Source/Python/Eot/EotMain.py > > index 791fcdfeaed8..68cc9f1239f5 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) > > + DecData.fromlist(array('B',TmpData).tolist()) > > except: > > TmpData =3D DeCompress('Framework', > self[self._HEADER_SIZE_:]) > > DecData =3D array('B') > > - DecData.fromstring(TmpData) > > + DecData.fromlist(array('B',TmpData).tolist()) > > > > SectionList =3D [] > > Offset =3D 0 > > @@ -196,7 +196,7 @@ class Ui(Image): > > return len(self) > > > > def _GetUiString(self): > > - return codecs.utf_16_decode(self[0:-2].tostring())[0] > > + return codecs.utf_16_decode(b"".join(list(map(lambda > > + x:bytes([x]), self[0:-2].tolist()))))[0] > > > > String =3D property(_GetUiString) > > > > @@ -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) > > + DecData.fromlist(array('B',TmpData).tolist()) > > Offset =3D 0 > > while Offset < len(DecData): > > Sec =3D Section() > > @@ -759,7 +759,7 @@ class GuidDefinedImage(Image): > > > > TmpData =3D DeCompress('Lzma', self[self.Offset:]) > > DecData =3D array('B') > > - DecData.fromstring(TmpData) > > + DecData.fromlist(array('B',TmpData).tolist()) > > Offset =3D 0 > > while Offset < len(DecData): > > Sec =3D Section() > > diff --git a/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py > b/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py > > index dc1727c4666d..83fa48187996 100644 > > --- a/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py > > +++ b/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py > > @@ -463,12 +463,12 @@ class GenFdsGlobalVariable: > > GenFdsGlobalVariable.SecCmdList.append(' > '.join(Cmd).strip()) > > else: > > SectionData =3D array('B', [0, 0, 0, 0]) > > - SectionData.fromstring(Ui.encode("utf_16_le")) > > + > > + SectionData.fromlist(array('B',Ui.encode('utf-16-le')).tolist()) > > SectionData.append(0) > > SectionData.append(0) > > Len =3D len(SectionData) > > > GenFdsGlobalVariable.SectionHeader.pack_into(SectionData, 0, Len & 0xff, > (Len >> 8) & 0xff, (Len >> 16) & 0xff, 0x15) > > - SaveFileOnChange(Output, SectionData.tostring()) > > + SaveFileOnChange(Output, b"".join(list(map(lambda > > + x:bytes([x]), SectionData.tolist())))) > > > > elif Ver: > > Cmd +=3D ("-n", Ver) > > -- > > 2.29.2.windows.2 > > > > > > > > > > > > >=20 >=20 >=20 >=20 >=20