From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail05.groups.io (mail05.groups.io [45.79.224.7]) by spool.mail.gandi.net (Postfix) with ESMTPS id A55D67803CC for ; Mon, 22 Apr 2024 01:37:02 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=McnkAtzptUQ/0AJupcWxjy7bGAAARuW1RT+Bc70EBO8=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Resent-Date:Resent-From:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20240206; t=1713749821; v=1; b=FETiCehKl0ks3UM25cMyLGaWRyI0sfz+InlNrmB1pzs5mH/s84mfmQsR6oKcD+OINpOg+g43 w/VrJabIqLSxUd8mB0l8nk7wTl8ZtQrkseVYmaE/wan6UnF1ltB430cXySqEluXVQ9BuGpHCLum FgSVbocn8PYq0y9e0VmMnc7lnE5J7JHmHrlioHmgy1TY5SQGrdgz0EXYxK96A5GzvWNioPGeJAb ByYygV5ay7flwSNMaOCo5h3uZshsT2qU5Gm0vJK9vh3tPr9tiI1RgU2+IlB4QNb3EpCYPGmgoZE nWAS4hPlh3a+Lk0Ngz1vcktY2Hc0MVc++L+BEEDSy8QuQ== X-Received: by 127.0.0.2 with SMTP id BkSBYY7687511xtWDDG4j1r6; Sun, 21 Apr 2024 18:37:01 -0700 X-Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.19]) by mx.groups.io with SMTP id smtpd.web11.8749.1713749815276833478 for ; Sun, 21 Apr 2024 18:37:00 -0700 X-CSE-ConnectionGUID: rYzTo22oTyOkleCBn7F0zQ== X-CSE-MsgGUID: v4wTKrafRoe/uYV4//OV8Q== X-IronPort-AV: E=McAfee;i="6600,9927,11051"; a="9151750" X-IronPort-AV: E=Sophos;i="6.07,219,1708416000"; d="scan'208";a="9151750" X-Received: from fmviesa009.fm.intel.com ([10.60.135.149]) by orvoesa111.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Apr 2024 18:37:00 -0700 X-CSE-ConnectionGUID: NvfkRau1QJmAisIO5s3KBg== X-CSE-MsgGUID: QBSBGIyMRRSAnbuQ8nAwRA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,219,1708416000"; d="scan'208";a="23885969" X-Received: from gguo-desk.gar.corp.intel.com ([10.225.76.26]) by fmviesa009.fm.intel.com with ESMTP; 21 Apr 2024 18:36:58 -0700 From: "Guo, Gua" To: devel@edk2.groups.io Cc: gua.guo@intel.com, Chasel Chiu , Nate DeSimone , Duggapu Chinni B , Star Zeng , Ted Kuo , Ashraf Ali S , Susovan Mohapatra Subject: [edk2-devel] [PATCH v1 2/2] IntelFsp2Pkg/PatchFv.py: Python 3.12 support Date: Mon, 22 Apr 2024 09:36:46 +0800 Message-Id: <20240422013646.1769-3-gua.guo@intel.com> In-Reply-To: <20240422013646.1769-1-gua.guo@intel.com> References: <20240422013646.1769-1-gua.guo@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Resent-Date: Sun, 21 Apr 2024 18:37:00 -0700 Resent-From: gua.guo@intel.com Reply-To: devel@edk2.groups.io,gua.guo@intel.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: qyX8UWjM1IVn7GHIPYTWQK7hx7686176AA= Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b=FETiCehK; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=intel.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 45.79.224.7 as permitted sender) smtp.mailfrom=bounce@groups.io From: Gua Guo Ref to https://docs.python.org/3/whatsnew/3.12.html A backslash-character pair that is not a valid escape sequence now generates Cc: Chasel Chiu Cc: Nate DeSimone Cc: Duggapu Chinni B Cc: Star Zeng Cc: Ted Kuo Cc: Ashraf Ali S Cc: Susovan Mohapatra Signed-off-by: Gua Guo --- IntelFsp2Pkg/Tools/PatchFv.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/IntelFsp2Pkg/Tools/PatchFv.py b/IntelFsp2Pkg/Tools/PatchFv.py index 73ab877c71..bd9aa71e3c 100644 --- a/IntelFsp2Pkg/Tools/PatchFv.py +++ b/IntelFsp2Pkg/Tools/PatchFv.py @@ -143,7 +143,7 @@ class Symbols: fdIn.close()=0D fvInfo['Base'] =3D 0=0D for rptLine in rptLines:=0D - match =3D re.match("^EFI_BASE_ADDRESS\s*=3D\s*(0x[a-fA-F0-9]+)= ", rptLine)=0D + match =3D re.match(r"^EFI_BASE_ADDRESS\s*=3D\s*(0x[a-fA-F0-9]+= )", rptLine)=0D if match:=0D fvInfo['Base'] =3D int(match.group(1), 16)=0D break=0D @@ -312,7 +312,7 @@ class Symbols: self.fdBase =3D 0xFFFFFFFF=0D while (rptLine !=3D "" ):=0D #EFI_BASE_ADDRESS =3D 0xFFFDF400=0D - match =3D re.match("^EFI_BASE_ADDRESS\s*=3D\s*(0x[a-fA-F0-9]+)= ", rptLine)=0D + match =3D re.match(r"^EFI_BASE_ADDRESS\s*=3D\s*(0x[a-fA-F0-9]+= )", rptLine)=0D if match is not None:=0D self.fdBase =3D int(match.group(1), 16) - fvOffset=0D break=0D @@ -340,7 +340,7 @@ class Symbols: fdIn =3D open(fvTxtFile, "r")=0D rptLine =3D fdIn.readline()=0D while (rptLine !=3D "" ):=0D - match =3D re.match("(0x[a-fA-F0-9]+)\s([0-9a-fA-F\-]+)", rptLi= ne)=0D + match =3D re.match(r"(0x[a-fA-F0-9]+)\s([0-9a-fA-F\-]+)", rptL= ine)=0D if match is not None:=0D if match.group(2) in self.dictFfsOffset:=0D self.dictFfsOffset[fvName + ':' + match.group(2)] =3D = "0x%08X" % (int(match.group(1), 16) + fvOffset)=0D @@ -374,10 +374,10 @@ class Symbols: while (rptLine !=3D "" ):=0D if rptLine[0] !=3D ' ':=0D #DxeIpl (Fixed Flash Address, BaseAddress=3D0x00fffb4310, = EntryPoint=3D0x00fffb4958,Type=3DPE)=0D - match =3D re.match("([_a-zA-Z0-9\-]+)\s\(.+BaseAddress=3D(= 0x[0-9a-fA-F]+),\s+EntryPoint=3D(0x[0-9a-fA-F]+),\s*Type=3D\w+\)", rptLine)= =0D + match =3D re.match(r"([_a-zA-Z0-9\-]+)\s\(.+BaseAddress=3D= (0x[0-9a-fA-F]+),\s+EntryPoint=3D(0x[0-9a-fA-F]+),\s*Type=3D\w+\)", rptLine= )=0D if match is None:=0D #DxeIpl (Fixed Flash Address, BaseAddress=3D0x00fffb43= 10, EntryPoint=3D0x00fffb4958)=0D - match =3D re.match("([_a-zA-Z0-9\-]+)\s\(.+BaseAddress= =3D(0x[0-9a-fA-F]+),\s+EntryPoint=3D(0x[0-9a-fA-F]+)\)", rptLine)=0D + match =3D re.match(r"([_a-zA-Z0-9\-]+)\s\(.+BaseAddres= s=3D(0x[0-9a-fA-F]+),\s+EntryPoint=3D(0x[0-9a-fA-F]+)\)", rptLine)=0D if match is not None:=0D foundModHdr =3D True=0D modName =3D match.group(1)=0D @@ -386,7 +386,7 @@ class Symbols: self.dictModBase['%s:BASE' % modName] =3D int (match.= group(2), 16)=0D self.dictModBase['%s:ENTRY' % modName] =3D int (match.= group(3), 16)=0D #(GUID=3D86D70125-BAA3-4296-A62F-602BEBBB9081 .textbaseadd= ress=3D0x00fffb4398 .databaseaddress=3D0x00fffb4178)=0D - match =3D re.match("\(GUID=3D([A-Z0-9\-]+)\s+\.textbaseadd= ress=3D(0x[0-9a-fA-F]+)\s+\.databaseaddress=3D(0x[0-9a-fA-F]+)\)", rptLine)= =0D + match =3D re.match(r"\(GUID=3D([A-Z0-9\-]+)\s+\.textbasead= dress=3D(0x[0-9a-fA-F]+)\s+\.databaseaddress=3D(0x[0-9a-fA-F]+)\)", rptLine= )=0D if match is not None:=0D if foundModHdr:=0D foundModHdr =3D False=0D @@ -399,7 +399,7 @@ class Symbols: else:=0D # 0x00fff8016c __ModuleEntryPoint=0D foundModHdr =3D False=0D - match =3D re.match("^\s+(0x[a-z0-9]+)\s+([_a-zA-Z0-9]+)", = rptLine)=0D + match =3D re.match(r"^\s+(0x[a-z0-9]+)\s+([_a-zA-Z0-9]+)",= rptLine)=0D if match is not None:=0D self.dictSymbolAddress["%s:%s"%(modName, match.group(2= ))] =3D match.group(1)=0D rptLine =3D fdIn.readline()=0D @@ -432,14 +432,14 @@ class Symbols: if reportLine.strip().find("Archive member included") !=3D -1:=0D #GCC=0D # 0x0000000000001d55 IoRead8=0D - patchMapFileMatchString =3D "\s+(0x[0-9a-fA-F]{16})\s+([^\s][^= 0x][_a-zA-Z0-9\-]+)\s"=0D + patchMapFileMatchString =3D r"\s+(0x[0-9a-fA-F]{16})\s+([^\s][= ^0x][_a-zA-Z0-9\-]+)\s"=0D matchKeyGroupIndex =3D 2=0D matchSymbolGroupIndex =3D 1=0D prefix =3D '_'=0D else:=0D #MSFT=0D #0003:00000190 _gComBase 00007a50 S= erialPo=0D - patchMapFileMatchString =3D "^\s[0-9a-fA-F]{4}:[0-9a-fA-F]{8}= \s+(\w+)\s+([0-9a-fA-F]{8,16}\s+)"=0D + patchMapFileMatchString =3D r"^\s[0-9a-fA-F]{4}:[0-9a-fA-F]{8= }\s+(\w+)\s+([0-9a-fA-F]{8,16}\s+)"=0D matchKeyGroupIndex =3D 1=0D matchSymbolGroupIndex =3D 2=0D prefix =3D ''=0D @@ -458,11 +458,11 @@ class Symbols: if handleNext:=0D handleNext =3D False=0D pcdName =3D match.group(1)=0D - match =3D re.match("\s+(0x[0-9a-fA-F]{16})\s+", repo= rtLine)=0D + match =3D re.match(r"\s+(0x[0-9a-fA-F]{16})\s+", rep= ortLine)=0D if match is not None:=0D modSymbols[prefix + pcdName] =3D match.group(1)=0D else:=0D - match =3D re.match("^\s\.data\.(_gPcd_BinaryPatch[_a-z= A-Z0-9\-]+)", reportLine)=0D + match =3D re.match(r"^\s\.data\.(_gPcd_BinaryPatch[_a-= zA-Z0-9\-]+)", reportLine)=0D if match is not None:=0D handleNext =3D True=0D continue=0D @@ -507,7 +507,7 @@ class Symbols: fdIn =3D open(xrefFile, "r")=0D rptLine =3D fdIn.readline()=0D while (rptLine !=3D "" ):=0D - match =3D re.match("([0-9a-fA-F\-]+)\s([_a-zA-Z0-9]+)", rptLin= e)=0D + match =3D re.match(r"([0-9a-fA-F\-]+)\s([_a-zA-Z0-9]+)", rptLi= ne)=0D if match is not None:=0D self.dictGuidNameXref[match.group(1).upper()] =3D match.gr= oup(2)=0D rptLine =3D fdIn.readline()=0D --=20 2.39.2.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#118061): https://edk2.groups.io/g/devel/message/118061 Mute This Topic: https://groups.io/mt/105662401/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-