From nobody Sun Feb 8 14:41:52 2026 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+64002+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+64002+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1597167954; cv=none; d=zohomail.com; s=zohoarc; b=SNENE3iiRjS6N5m0JSoJbMBZgf+c8KRp0rPs7pQ3biTlDimz+SeyNcjdCIQ/b3s58KY2GyAaWrWfZbQJLj8/Zp6GX7AMVfinGx2IzNpT4tiM3gn0E30hLMjjA0lKdAmikG+b8zLNdpT//P34/sU03FlRdO/wLqxk3S0EVCiMKIc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1597167954; 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=FPck5Nc++QDuO4xQ24jBxBGFriZWjSVY98sbDDFdyBU=; b=GRN1ISJyy2o3+dW5s6DQgxl9Ui2vRK+QUcQ3tM/pL0PDl/RJjpr20PR7URf2JDUqKdRJK1dUTGztwCmcnJZBm7r2BegHqmm/SHWqxU2OrJMUhLmU+rBugIDGcOaBrpZY8q+iPdHRwpIJyuI9ZoMSa9dy0+ttms11hn8RAsu+YVo= 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+64002+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1597167954933292.41123760504263; Tue, 11 Aug 2020 10:45:54 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id kwLRYY1788612xSPpa7IDqR6; Tue, 11 Aug 2020 10:45:54 -0700 X-Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.120]) by mx.groups.io with SMTP id smtpd.web12.302.1597167131109162282 for ; Tue, 11 Aug 2020 10:32:11 -0700 X-Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-223-hFk-m0AlO5Sa7_Ah4__nIw-1; Tue, 11 Aug 2020 13:32:06 -0400 X-MC-Unique: hFk-m0AlO5Sa7_Ah4__nIw-1 X-Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8D73B79EC2; Tue, 11 Aug 2020 17:32:04 +0000 (UTC) X-Received: from worklaptop.redhat.com (ovpn-118-49.rdu2.redhat.com [10.10.118.49]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0A4BB10016E8; Tue, 11 Aug 2020 17:32:03 +0000 (UTC) From: "Cole" To: devel@edk2.groups.io Cc: bob.c.feng@intel.com, liming.gao@intel.com, Cole Robinson Subject: [edk2-devel] [PATCH 1/2] BaseTools: fix ucs-2 lookup on python 3.9 Date: Tue, 11 Aug 2020 13:28:17 -0400 Message-Id: <1ded5a5bfc3e3a83eba56fa0875db037e60a7c4e.1597166808.git.crobinso@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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,crobinso@redhat.com X-Gm-Message-State: 9sS5YnKfARKaRZ3L52o7Xsy1x1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1597167954; bh=Gn5YZiVBa7UhzAeltZD4RvIbPduBkMeMJwxkwKUseHw=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=LyuNIjDORq5LjrgFp14ryOCkrCX54H1CYUKgdhJ0irLg9SGICRF1gG7cuVabyCvSbh6 zUg0PAXuIo4dDcP8at2DLumM4dmmUlZ7G5Bs7ZeyQHAX+5uwiqCcrxt0yDgCMAStKUa2s Pxwc5W6kNrpDGYjd3T+B24E4Jil85CRnf34= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" python3.9 changed/fixed codec.register behavior to always replace hyphen with underscore for passed in codec names: https://bugs.python.org/issue37751 So the custom Ucs2Search needs to be adapted to handle 'ucs_2' in addition to existing 'ucs-2' for back compat. This fixes test failures on python3.9, example: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D FAIL: testUtf16InUniFile (CheckUnicodeSourceFiles.Tests) Reviewed-by: Bob Feng Reviewed-by: Yuwei Chen ---------------------------------------------------------------------- Traceback (most recent call last): File "/builddir/build/BUILD/edk2-edk2-stable202002/BaseTools/Source/Pytho= n/AutoGen/UniClassObject.py", line 375, in PreProcess FileIn =3D UniFileClassObject.OpenUniFile(LongFilePath(File.Path)) File "/builddir/build/BUILD/edk2-edk2-stable202002/BaseTools/Source/Pytho= n/AutoGen/UniClassObject.py", line 303, in OpenUniFile UniFileClassObject.VerifyUcs2Data(FileIn, FileName, Encoding) File "/builddir/build/BUILD/edk2-edk2-stable202002/BaseTools/Source/Pytho= n/AutoGen/UniClassObject.py", line 312, in VerifyUcs2Data Ucs2Info =3D codecs.lookup('ucs-2') LookupError: unknown encoding: ucs-2 Signed-off-by: Cole Robinson --- BaseTools/Source/Python/AutoGen/UniClassObject.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BaseTools/Source/Python/AutoGen/UniClassObject.py b/BaseTools/= Source/Python/AutoGen/UniClassObject.py index b2895f7e5c..883c2356e0 100644 --- a/BaseTools/Source/Python/AutoGen/UniClassObject.py +++ b/BaseTools/Source/Python/AutoGen/UniClassObject.py @@ -152,7 +152,7 @@ class Ucs2Codec(codecs.Codec): =20 TheUcs2Codec =3D Ucs2Codec() def Ucs2Search(name): - if name =3D=3D 'ucs-2': + if name in ['ucs-2', 'ucs_2']: return codecs.CodecInfo( name=3Dname, encode=3DTheUcs2Codec.encode, --=20 2.26.2 -=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 (#64002): https://edk2.groups.io/g/devel/message/64002 Mute This Topic: https://groups.io/mt/76131665/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-