From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 260BE740038 for ; Tue, 7 Nov 2023 16:59:17 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=ADWULqKXRDCeiZ6tIQtnps5JwD03BiAiyE38GRdUq2g=; c=relaxed/simple; d=groups.io; h=Feedback-ID:Message-ID:Date:MIME-Version:User-Agent:Subject:To:Cc:References:From:In-Reply-To:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20140610; t=1699376355; v=1; b=HhkvSF6Vg0abeMZfU1enq4efwRD78ycH55NemQejA7iXkALk50ovNmIIlMWQNNvLk31yZ1jc XIi5YcpiLiuBoeLcrz36F92HcC0wt167Ra4CldjJyz9Ik7JqZjS6DyST4WNz9mHG+TKCU9QFX3P oPZkXFJC7hhvTfofpYLeDPHM= X-Received: by 127.0.0.2 with SMTP id KQANYY7687511xK4DZYAEG2h; Tue, 07 Nov 2023 08:59:15 -0800 X-Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by mx.groups.io with SMTP id smtpd.web10.40.1699376354754709111 for ; Tue, 07 Nov 2023 08:59:15 -0800 X-Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 0324D5C019D; Tue, 7 Nov 2023 11:59:14 -0500 (EST) X-Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Tue, 07 Nov 2023 11:59:14 -0500 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedruddujedgtdefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtvdejnecuhfhrohhmpeftvggs vggttggrucevrhgrnhcuoehrvggsvggttggrsegsshguihhordgtohhmqeenucggtffrrg htthgvrhhnpefhkedvkedvhfdtvdetheeuueelteejhfeiheejuefhtddutddvgedutdek veelhfenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe hrvggsvggttggrsegsshguihhordgtohhm X-ME-Proxy: Feedback-ID: i5b994698:Fastmail X-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 7 Nov 2023 11:59:12 -0500 (EST) Message-ID: Date: Tue, 7 Nov 2023 09:59:10 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [edk2-devel] [PATCH v1 1/1] BaseTools: Resolve invalid escape sequence To: Joey Vagedes , devel@edk2.groups.io Cc: Liming Gao , Bob Feng , Yuwei Chen References: <20231031062349.171749-1-joeyvagedes@microsoft.com> From: "Rebecca Cran" In-Reply-To: <20231031062349.171749-1-joeyvagedes@microsoft.com> 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 Reply-To: devel@edk2.groups.io,rebecca@bsdio.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: YopNXd7bDjyQF6qddT7ykrtox7686176AA= Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=HhkvSF6V; dmarc=none; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io Reviewed-by: Rebecca Cran On 10/31/2023 12:23 AM, Joey Vagedes wrote: > Resolves an invalid escape sequence in a regex string that occurs > because the string was not marked as a raw string, so backslash > characters create unexpected escape sequences. > > This was brought to light due to Python 3.12 now detecting invalid > escape sequences and generates a warning. It is best practice to > always use raw strings for regex strings. > > Cc: Rebecca Cran > Cc: Liming Gao > Cc: Bob Feng > Cc: Yuwei Chen > Signed-off-by: Joey Vagedes > --- > BaseTools/Scripts/BinToPcd.py | 11 +++++------ > 1 file changed, 5 insertions(+), 6 deletions(-) > > diff --git a/BaseTools/Scripts/BinToPcd.py b/BaseTools/Scripts/BinToPcd.p= y > index 460c08b7f7cd..43fc458b0426 100644 > --- a/BaseTools/Scripts/BinToPcd.py > +++ b/BaseTools/Scripts/BinToPcd.py > @@ -10,13 +10,12 @@ BinToPcd > ''' > > from __future__ import print_function > > =20 > > -import sys > > import argparse > > -import re > > -import xdrlib > > import io > > -import struct > > import math > > +import re > > +import struct > > +import sys > > =20 > > # > > # Globals for help information > > @@ -38,13 +37,13 @@ if __name__ =3D=3D '__main__': > return Value > > =20 > > def ValidatePcdName (Argument): > > - if re.split ('[a-zA-Z\_][a-zA-Z0-9\_]*\.[a-zA-Z\_][a-zA-Z0-9\_]*= ', Argument) !=3D ['', '']: > > + if re.split (r'[a-zA-Z\_][a-zA-Z0-9\_]*\.[a-zA-Z\_][a-zA-Z0-9\_]= *', Argument) !=3D ['', '']: > > Message =3D '{Argument} is not in the form .'.format (Argument =3D Argument) > > raise argparse.ArgumentTypeError (Message) > > return Argument > > =20 > > def ValidateGuidName (Argument): > > - if re.split ('[a-zA-Z\_][a-zA-Z0-9\_]*', Argument) !=3D ['', '']= : > > + if re.split (r'[a-zA-Z\_][a-zA-Z0-9\_]*', Argument) !=3D ['', ''= ]: > > Message =3D '{Argument} is not a valid GUID C name'.format = (Argument =3D Argument) > > raise argparse.ArgumentTypeError (Message) > > return Argument > -=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 (#110866): https://edk2.groups.io/g/devel/message/110866 Mute This Topic: https://groups.io/mt/102305837/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-