From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mx.groups.io with SMTP id smtpd.web10.5491.1588073751564122709 for ; Tue, 28 Apr 2020 04:35:51 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=XP4cLqoM; spf=pass (domain: intel.com, ip: 192.55.52.136, mailfrom: bob.c.feng@intel.com) IronPort-SDR: l1lY4PzNy9/LweGN5vFtw0HecJr3mwC8jWxg+8prAmF2F0cozdpCQwi6Au97txfI2OD1hWCJJ9 EU+z5CD76c+Q== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Apr 2020 04:35:51 -0700 IronPort-SDR: WhJ8J9eA9pzJQzZpXomBFmUB169YROAjsgl7YtGBY/eDwv1vFqQSYXjTUzTXfUD27YcL7WeQMH eVaRzrUYVVCQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,327,1583222400"; d="scan'208";a="302685367" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by FMSMGA003.fm.intel.com with ESMTP; 28 Apr 2020 04:35:51 -0700 Received: from fmsmsx119.amr.corp.intel.com (10.18.124.207) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 28 Apr 2020 04:35:50 -0700 Received: from FMSEDG002.ED.cps.intel.com (10.1.192.134) by FMSMSX119.amr.corp.intel.com (10.18.124.207) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 28 Apr 2020 04:35:50 -0700 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (104.47.56.175) by edgegateway.intel.com (192.55.55.69) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 28 Apr 2020 04:35:50 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IOCECCRNH/7wMJcr2MMuDD7ATjXyPv4LuQCO/ka4hW+2ekVgYG+YNCGBj+oy3Ffa8mz3P+zKChsKy5W4xz6BsWFaG3BdXknTwI9gG7J8+Ea/Q2FaLlusFP2YWn/6Tj1aZuh8GvxQfLyDkcyf6iYSOEiGnYj1//FFANo+OTLqjhYftpmf4Ytfh7AhRQxJ1tE4h2ADVoiA+SFpGk2YNoZ6HOW2531nuz0tNCzxKvZKR4cubLksS8Fq6Pw9WJXWTZSq9irqxcZE1J7CuT6Aga5qUKr5L7GoFBt0XkS4zmIW1S/ft5PJPpcFK9idE8Bkuo/qIsCgClrT/rCFkPwBDxzQoA== 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=IDklL7ZxzK+Cy9xU/gz0mV7uD10nzEzneeVrR8MHRL0=; b=Weo9TifSERzlO/C/06Eo5JuY/tw7Djg1HmymJQbzUnqRoRQPg1+djsPxGqAKqb+TyOFWGDGWQQtuuoWcICoGXCGXu/xzZrxeiM742kF2FvwaFV5LRYVmTgDXM8OXI0dH+MvAXJ/SLaXDp2weRuAl7jUx6eQzNsHzgXTWAMQy6C2QbXFL2mWR/Cn1yBHMNF9AUCT8qUZ1uMMq9jho9oM0YBlKrMWYwpul/Ho+JxRGkL4gxoLFI3AgLnfW+zrJt24unQe0RNoYo4DXz49CyM2dK54VcRgLf1na8lQSKzxtJ9yil1O7SEUhlezCWfKWOTskNsQNJVOgOn86R8wC+VaQrg== 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=IDklL7ZxzK+Cy9xU/gz0mV7uD10nzEzneeVrR8MHRL0=; b=XP4cLqoM9BdvqQKzBKYnro1k/QUkOBsRBZjOPio+x1xOlHNb8YBCs5ikWbIUrkwmr5Vse7ep9X7EQZCOdlvCoezMqAcE22ZlwSE9RsTTWrNMvciHDPix9Z/ZRqT8oZY+Rz7b8065w72+7pQ+N7ZwohkrLD/S+FfUBvEnQiuUFH0= Received: from BN6PR11MB0068.namprd11.prod.outlook.com (2603:10b6:405:69::17) by BN6PR11MB1841.namprd11.prod.outlook.com (2603:10b6:404:102::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.22; Tue, 28 Apr 2020 11:35:49 +0000 Received: from BN6PR11MB0068.namprd11.prod.outlook.com ([fe80::2d53:d47c:1269:d601]) by BN6PR11MB0068.namprd11.prod.outlook.com ([fe80::2d53:d47c:1269:d601%6]) with mapi id 15.20.2937.023; Tue, 28 Apr 2020 11:35:49 +0000 From: "Bob Feng" To: "devel@edk2.groups.io" , "leif@nuviainc.com" , "Gao, Liming" Subject: Re: [edk2-devel] [PATCH 1/1] BaseTools: explicitly import decode_header PatchCheck.py Thread-Topic: [edk2-devel] [PATCH 1/1] BaseTools: explicitly import decode_header PatchCheck.py Thread-Index: AQHWF/OZIFs4E0n/r0Cli42mb7Y0w6iNI7CAgAAFHYCAAUdRAA== Date: Tue, 28 Apr 2020 11:35:49 +0000 Message-ID: References: <20200421154222.32485-1-leif@nuviainc.com> <20200427155603.GT14075@vanye> In-Reply-To: <20200427155603.GT14075@vanye> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: 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.36] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 1136a6c8-4632-4cd8-5e05-08d7eb684ce6 x-ms-traffictypediagnostic: BN6PR11MB1841: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:10000; x-forefront-prvs: 0387D64A71 x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BN6PR11MB0068.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(39850400004)(376002)(346002)(396003)(136003)(366004)(26005)(66476007)(66446008)(66946007)(33656002)(52536014)(186003)(86362001)(64756008)(6636002)(76116006)(66556008)(5660300002)(7696005)(2906002)(478600001)(8676002)(966005)(110136005)(6506007)(71200400001)(9686003)(81156014)(316002)(8936002)(53546011)(55016002)(21314003);DIR:OUT;SFP:1102; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: TS03iZa6Sl5sb0PBSSpqjXo7yUHZ+twEFWWEP1oEd4xlsvCVQMqobxAxPH5fByby0Nr0noF4uCcqJTvE9VJeA+nIr+gd+mcNwbD1sSyBfkiIvsaEfNdvlQ9NURyb+Cbt7XcEiuIWY0KwBOH+rTmwvGMrAAkg+L6ln9hTKqJTxLtTPdwxAndczOlQjziOAkeVBkaCC0d/UbXD/lsUg1tHqkcwpXfLYqnwjytAh6rAlSNXZ48RPPM1ssW8HthR0AY/7HDeIkFJUZkdOt6u1dWwpIZWIegaey9fl72KonjkPf276THXsBqzUI/B4pbD2junwT1rjU84sAzriHL1+HBIXQ1STk1O0aNAEVr3190kDCJQhT8rLwplXky4X/iij70YslG/Sj17uffI4mm8BKZ/06NZKWfb+nAadFksfiCa5Xytd67fnX7zPXt2xT5fSDkz37zgjz2jGNRfC5ln2Ld/zOssVvPGa94VrbkXRZf8ZpcgcRwEIyAFcd8ou5EoF/GM0monwx56uLpDZ+0VhAqqAHWQ30RCoQpWar1884g/f5sm4E9wy4crs9HAEoQbdoY9 x-ms-exchange-antispam-messagedata: YJvlU3GVV3harOLYa/ae0Wv/vvao/Y8v6dBM3dUKYKh7BleGu8OwBLeyKQLsbFyKOrKB3eWavB4KT9u8N+4w7MxkAqOFCNtakEEHQGUYGhXCD+UZ2bcAXi+bhjTV/XguI4Drl9qujlv6bbcgdSD6KK04f7uZV/icLSWkdaiTXsqs7pEQt7KJl9vK0ak1V/BR7hqlnX9vE820CzpZS1TZDzoCLAJvNvko44A09vQjPBZy97uX9n2XoEe68HdoNydZxmjP/ybybbxpHR9USkbMyuWR1qwkSFUcZRzUgEf43KRfPZDY12aOqM4nmEyhfICwqgUOGVTxwC2kn0RdsQSQULIwGc3VXByUqxTt3W8jVrM+jGJ+dM/OMMlWQfEAvv/G2Ovu6YYDNUU4SeMUHfb9ykK7W3mHilS3mMAqEtMjTNcsDKP0YOK+S3MEUGp1RHnegQRpUCA9HyY4MT+5TKabgzR2uOMiD/6RA3NriNjGjkzKEFCKJXIQGyZksG0VtR0Guz9rmZxl3OBuK7Tnw7vUUCmNLuQIbPJ48CofB8fxIF2s5yYjYSGOFVyr93CpMmhOd/gVvYKUr+RhRu+ijgZwlxs+uzij9QS319LzCbjpzjG84mNVfxH+7mJ/9XqYcORQv6ThVJ0kIw7yro9xX7h/sELk/7zE6fKe5b428GXNAoCd7jBoMr/TZ2nbr8QJiexHNjYc61IOB7G79lvptC25i4PxdfgpF1qsF84u/yCcV4jeLrydvyVPUGaxBAmB0afVqAiYUsi0GcPqyRdsWl9MtRDJ53kR5gmX4RqcG90lM7Q= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 1136a6c8-4632-4cd8-5e05-08d7eb684ce6 X-MS-Exchange-CrossTenant-originalarrivaltime: 28 Apr 2020 11:35:49.3787 (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: qTxrTz+PrYNuqXOu6SvQmLMYd1Eb6DmbcdYmfYc9P5oCZ1aa3OEY0Uknzf/7nynnFISCxA6Q1joxHoxuubC+fg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR11MB1841 Return-Path: bob.c.feng@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Leif, I check the email/__init__.py, the difference between py2 and py3 is that = py2 email/__init__.py list both "Header" and "header" as email module publi= c interface. I tried to change the line 595, from email.header.XXX to email= .Header.XXX. the issue is gone for py2. Looks the "Header" hide the "header= ". Since the decode_header is the interface of the email.header module, I thi= nk the patch can be simplify as=20 - import email + import email.header Thanks, Bob -----Original Message----- From: devel@edk2.groups.io On Behalf Of Leif Lindho= lm Sent: Monday, April 27, 2020 11:56 PM To: Gao, Liming Cc: devel@edk2.groups.io; Feng, Bob C Subject: Re: [edk2-devel] [PATCH 1/1] BaseTools: explicitly import decode_= header PatchCheck.py Hi Liming, Yes - this is part of https://docs.python.org/3/library/email.header.html (or for Python 2, https://docs.python.org/2/library/email.header.html). Someone with better python knowledge than me may be able to explain why th= e implicit import is required for Python 2 (at least in my setup) but not Python 3. / Leif On Mon, Apr 27, 2020 at 15:37:45 +0000, Gao, Liming wrote: > Lefi: > Is email.header built-in lib? If this change doesn't require user to i= nstall the additional python library, I am OK with change.=20 >=20 > > -----Original Message----- > > From: devel@edk2.groups.io On Behalf Of Leif=20 > > Lindholm > > Sent: Tuesday, April 21, 2020 11:42 PM > > To: devel@edk2.groups.io > > Cc: Feng, Bob C ; Gao, Liming=20 > > > > Subject: [edk2-devel] [PATCH 1/1] BaseTools: explicitly import=20 > > decode_header PatchCheck.py > >=20 > > On Debian 10 (Buster), when running PatchCheck.py with python2, a=20 > > backtrace is printed, starting from: > >=20 > > File "../edk2/BaseTools/Scripts/PatchCheck.py", line 595, in find_pa= tch_pieces > > parts =3D email.header.decode_header(pmail.get('subject')) > > AttributeError: 'module' object has no attribute 'header' > >=20 > > When using python3, this backtrace does not appear. > >=20 > > Explicitly importing decode_header resolves this for python2 and=20 > > does not appear to cause any issues with python3. > >=20 > > Cc: Bob Feng > > Cc: Liming Gao > > Signed-off-by: Leif Lindholm > > --- > >=20 > > I'm pretty sure this used to work with python 2, but I'm not sure=20 > > when it stopped... > >=20 > > BaseTools/Scripts/PatchCheck.py | 2 ++ > > 1 file changed, 2 insertions(+) > >=20 > > diff --git a/BaseTools/Scripts/PatchCheck.py=20 > > b/BaseTools/Scripts/PatchCheck.py index 13da6967785d..675ce273e830=20 > > 100755 > > --- a/BaseTools/Scripts/PatchCheck.py > > +++ b/BaseTools/Scripts/PatchCheck.py > > @@ -19,6 +19,8 @@ import re > > import subprocess > > import sys > >=20 > > +from email.header import decode_header > > + > > class Verbose: > > SILENT, ONELINE, NORMAL =3D range(3) > > level =3D NORMAL > > -- > > 2.20.1 > >=20 > >=20 > >=20 >=20