From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mx.groups.io with SMTP id smtpd.web11.159.1597277795799769832 for ; Wed, 12 Aug 2020 17:16:36 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=hNjPZsOb; spf=pass (domain: intel.com, ip: 192.55.52.43, mailfrom: yuwei.chen@intel.com) IronPort-SDR: UkK/SsXoDx051n8LwfTTCopoQZjXFNFA69wWJYXC4Htn6IDDED/Qr0tkBUm+tMb4l3g7H6JeGU oocCwjsCP1Uw== X-IronPort-AV: E=McAfee;i="6000,8403,9711"; a="238956980" X-IronPort-AV: E=Sophos;i="5.76,306,1592895600"; d="scan'208";a="238956980" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Aug 2020 17:16:35 -0700 IronPort-SDR: Z5HtFBax/Q/xAUDURP88nt1LilFGX+R0juduQbp9yT6tQREUJUtm4LE9Pn5CTONPi8T6yQifjq 2Iqj9WoMyuOQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,306,1592895600"; d="scan'208";a="295255390" Received: from orsmsx604-2.jf.intel.com (HELO ORSMSX604.amr.corp.intel.com) ([10.22.229.84]) by orsmga006.jf.intel.com with ESMTP; 12 Aug 2020 17:16:34 -0700 Received: from orsmsx604.amr.corp.intel.com (10.22.229.17) by ORSMSX604.amr.corp.intel.com (10.22.229.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Wed, 12 Aug 2020 17:16:34 -0700 Received: from orsmsx105.amr.corp.intel.com (10.22.225.132) by orsmsx604.amr.corp.intel.com (10.22.229.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1713.5 via Frontend Transport; Wed, 12 Aug 2020 17:16:34 -0700 Received: from ORSEDG002.ED.cps.intel.com (10.7.248.5) by ORSMSX105.amr.corp.intel.com (10.22.225.132) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 12 Aug 2020 17:16:34 -0700 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.169) by edgegateway.intel.com (134.134.137.101) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 12 Aug 2020 17:16:34 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YXenkVKbOOIn1e9sRBZTj0ttdm7Blegw3ExxKGh0GhvDiCCMlt2wT6N/EDEge1czeqzPRuQ14NhAeeI0XldkgmENntEhoHYBYdpM828O+NDEwj6D5TG8LBBdMev8A0ozrdmcdh/a+x/3FyfOEdxiSYqb/9BO5Omrcy123Ll4oqinfO6HMbu672NZMyW4GvCCpeWWmp/kS2NOeqU1XJk026ydzVrHd65qXC8NMDJaqkZk8Sved3BJ0yMDmYr1a82NlNApOxKXYO5M3PNJQJJS7EVFuhremJEw7teu4Ejdgy4gGvaUS+QsZHeHlYJN+G5YCmKIXpz0ty35axPfnc3Zuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=YxCB7MI6AugW9ptIqfVZAFzAWjoo7rJNS506+myDzAg=; b=YnIcURryI4UrOua/rMPSGRTkuBQeoKxbExf1qz/b6dgslYiyWeT4mOle2c1Uv4PpPs1//Yv4922a3RoQkR22cCY3FcXMs8W4LDJKdhQEWt5krTeMjpVj8QAkYKvCVE/kz3uXboaMhmE+7Cfeaz0sd32pCIFE4WX+zHV1rGG7ZgkRWA1+1FGSYoiJz2EOUP4PyhyuVVdP54sylcuq/YlNBe5pZubyIciRL844+zXlwi/EoK+A1OO9WMA+FWxbbdcRptovcLqRi/iWM/tMFkINrfvxiB3r6WDJOF7UzjBV4lfLzH9aMahnUAdLnbvFBe04NmeizGA1wXW4ixddxIKEAA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=YxCB7MI6AugW9ptIqfVZAFzAWjoo7rJNS506+myDzAg=; b=hNjPZsObk1FUHcRzshFCmwUgJm3Atocf5Bm4XtwLvD3QjhdpXBntNxP48qO9rHUCGPMfD/Sf5lBxgSbRYpesGvmC/lCZLUdAQ2Q88cYYCeq3qcINo4dK+a6VaYKBNjlDBc87CH84vMeYcl15LdDk7AfDWU/0LVClcyOEEGv7Txc= Received: from DM5PR11MB1594.namprd11.prod.outlook.com (10.172.34.144) by DM6PR11MB4738.namprd11.prod.outlook.com (20.180.252.210) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3283.16; Thu, 13 Aug 2020 00:16:33 +0000 Received: from DM5PR11MB1594.namprd11.prod.outlook.com ([fe80::503:d97b:c650:831d]) by DM5PR11MB1594.namprd11.prod.outlook.com ([fe80::503:d97b:c650:831d%12]) with mapi id 15.20.3283.015; Thu, 13 Aug 2020 00:16:33 +0000 From: "Yuwei Chen" To: "devel@edk2.groups.io" , "crobinso@redhat.com" CC: "Feng, Bob C" , "Gao, Liming" Subject: Re: [edk2-devel] [PATCH 1/2] BaseTools: fix ucs-2 lookup on python 3.9 Thread-Topic: [edk2-devel] [PATCH 1/2] BaseTools: fix ucs-2 lookup on python 3.9 Thread-Index: AQHWcAdKijA9FvvOAUCTnpr1UXGnE6k1LdLg Date: Thu, 13 Aug 2020 00:16:32 +0000 Message-ID: References: <1ded5a5bfc3e3a83eba56fa0875db037e60a7c4e.1597166808.git.crobinso@redhat.com> In-Reply-To: <1ded5a5bfc3e3a83eba56fa0875db037e60a7c4e.1597166808.git.crobinso@redhat.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-version: 11.5.1.3 dlp-reaction: no-action dlp-product: dlpe-windows authentication-results: edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=none action=none header.from=intel.com; x-originating-ip: [192.102.204.38] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: ba5cb722-5548-4cc2-7c39-08d83f1e2251 x-ms-traffictypediagnostic: DM6PR11MB4738: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1824; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: ZmKkg8IcmOaMCX7GkOsAryxMAEO+4h9dne4eQ/eEVl95PMBDuzvRNFtNJ5FJyb3EtwBRKCcSwhnhfLS88fqGv0w3uqagVasKmaFOLqyI1YTx4Jg1CqQpYH1mVsh61cGf/gN4TOz556IkFQZddB9kclLiTV6tg8Z2VE1KzaNIHXuoqZ40Un628fPMEST12GwuApp1JQ+pXlHjiOzGdSEyrbaeKKSAYFBbjyhdCKFr4ol6yiYHIc5E4tBWbF36RfLiH3vkEEivpQAceGNjssSCTliZY4MeX5Q5fXQktHN+lPVC2EP5yrIZK91ufL/DPhj4qDB/lsw/SytQa6IpptTdjbsCLLf6qZQ0KQ5gTWZv8WxZCGM9Z7UG82HW84jGoxAKrtSDw9iNo6uKp3c5SczpwQ== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM5PR11MB1594.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(376002)(39860400002)(136003)(346002)(366004)(396003)(966005)(186003)(478600001)(2906002)(86362001)(7696005)(6506007)(26005)(53546011)(83380400001)(19627235002)(8676002)(33656002)(54906003)(71200400001)(64756008)(66446008)(66476007)(76116006)(66946007)(107886003)(66556008)(9686003)(55016002)(5660300002)(52536014)(316002)(110136005)(8936002)(4326008);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: MZaMXwDzQi9vgHwMvIMaeJLEpPrz1m/QYK3Xj3IO0vZw/VPc5p6rXqy7SAH94egOKk/H0fpKE/T4uzw74v8u45+fcZ/+AaxzNsRqbwiAafCvUoncpJyJubUMI4SGf7msl/MJUS/Itcsa152b5aloL8ZXg7d4bEjYEdzM5SLiorDeA6+LT+2jQwaZ8nAOCmepqxfAT1LPcleA2PcEewv6KcWxIbqNgMSLwJxQJSzS7usiFjezPsH5ggxM7qwte7SRd7xq+zOyG6PEBn4VMUcFSpgGy7E9LuPMvFRUgeAXlFkrTo37qW9vRR5nO0bagAcIpAw7Ergd2pvBxKwAgiTRovMXQchC/t73oJN7kze34WikRlv0XVXOAgkkz5Z1NtHSJPenJ8lajW6lG/MvV6IoAzuDbeyvO19ICxDAQI2lwutsZ2KapVKwqTtnJKRbTF22V0b/hF6Mr3UYwPXEh/XqJvYuOjaDgM9XAYyt5e4yuKb7nCg9ODh+DWwyi0pIG4q9GgCBIGEYDYoPHoeJy23h9OnvsM213paMy6BPdNWB0F9F+cS4AjW7eeUJ4hDCfCy3hbU+/8U6j6HdQngYShk257evhvAoACyBfLrQ16FO0uT8VVE9ASzbCD/OJTCSNDgD47g5GABCKI1bkgi9cx4c6w== MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM5PR11MB1594.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: ba5cb722-5548-4cc2-7c39-08d83f1e2251 X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Aug 2020 00:16:32.9459 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: j3eik5UJAoLiwQqM3vgjuxNd6YxWou4h0+MxkUo7rja9zApuDZ9Z0Rz943jveiFfbsDs1iTzOQs+uipU8Qi6xw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB4738 Return-Path: yuwei.chen@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Yuwei Chen > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of Cole > Sent: Wednesday, August 12, 2020 1:28 AM > To: devel@edk2.groups.io > Cc: Feng, Bob C ; Gao, Liming > ; Cole Robinson > Subject: [edk2-devel] [PATCH 1/2] BaseTools: fix ucs-2 lookup on python = 3.9 >=20 > python3.9 changed/fixed codec.register behavior to always replace hyphen > with underscore for passed in codec names: >=20 > https://bugs.python.org/issue37751 >=20 > So the custom Ucs2Search needs to be adapted to handle 'ucs_2' in additi= on > to existing 'ucs-2' for back compat. >=20 > This fixes test failures on python3.9, example: >=20 > =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) > ---------------------------------------------------------------------- > Traceback (most recent call last): > File "/builddir/build/BUILD/edk2-edk2- > stable202002/BaseTools/Source/Python/AutoGen/UniClassObject.py", line > 375, in PreProcess > FileIn =3D UniFileClassObject.OpenUniFile(LongFilePath(File.Path)) > File "/builddir/build/BUILD/edk2-edk2- > stable202002/BaseTools/Source/Python/AutoGen/UniClassObject.py", line > 303, in OpenUniFile > UniFileClassObject.VerifyUcs2Data(FileIn, FileName, Encoding) > File "/builddir/build/BUILD/edk2-edk2- > stable202002/BaseTools/Source/Python/AutoGen/UniClassObject.py", line > 312, in VerifyUcs2Data > Ucs2Info =3D codecs.lookup('ucs-2') > LookupError: unknown encoding: ucs-2 >=20 > Signed-off-by: Cole Robinson > --- > BaseTools/Source/Python/AutoGen/UniClassObject.py | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > 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, > -- > 2.26.2 >=20 >=20 >=20