From: "Bob Feng" <bob.c.feng@intel.com>
To: "devel@edk2.groups.io" <devel@edk2.groups.io>,
"leif@nuviainc.com" <leif@nuviainc.com>
Cc: "Gao, Liming" <liming.gao@intel.com>
Subject: Re: [edk2-devel] [PATCH 2/2] BaseTools: explicitly import email.header PatchCheck.py
Date: Thu, 2 Jul 2020 15:48:12 +0000 [thread overview]
Message-ID: <BN6PR11MB0068BF04A8A215A59BE2DC83C96D0@BN6PR11MB0068.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20200702153934.25262-3-leif@nuviainc.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Leif Lindholm
Sent: Thursday, July 2, 2020 11:40 PM
To: devel@edk2.groups.io
Cc: Feng, Bob C <bob.c.feng@intel.com>; Gao, Liming <liming.gao@intel.com>
Subject: [edk2-devel] [PATCH 2/2] BaseTools: explicitly import email.header PatchCheck.py
On Debian 10 (Buster), when running PatchCheck.py with python2, a backtrace is printed, starting from:
File "../edk2/BaseTools/Scripts/PatchCheck.py", line 595,
in find_patch_pieces
parts = email.header.decode_header(pmail.get('subject'))
AttributeError: 'module' object has no attribute 'header'
When using python3, this backtrace does not appear.
Explicitly importing email.header resolves this for python2 and does not appear to cause any issues with python3.
Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Leif Lindholm <leif@nuviainc.com>
---
BaseTools/Scripts/PatchCheck.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/BaseTools/Scripts/PatchCheck.py b/BaseTools/Scripts/PatchCheck.py index 527761986d4c..52244b0bc4d8 100755
--- a/BaseTools/Scripts/PatchCheck.py
+++ b/BaseTools/Scripts/PatchCheck.py
@@ -20,6 +20,8 @@ import re
import subprocess
import sys
+import email.header
+
class Verbose:
SILENT, ONELINE, NORMAL = range(3)
level = NORMAL
--
2.20.1
next prev parent reply other threads:[~2020-07-02 15:48 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-02 15:39 [PATCH 0/2] BaseTools: minor PatchCheck.py fixes/changes Leif Lindholm
2020-07-02 15:39 ` [PATCH 1/2] BaseTools/PatchCheck.py: add exception for diff orderfile Leif Lindholm
2020-07-02 23:47 ` [edk2-devel] " Bob Feng
2020-07-02 15:39 ` [PATCH 2/2] BaseTools: explicitly import email.header PatchCheck.py Leif Lindholm
2020-07-02 15:48 ` Bob Feng [this message]
2020-07-03 7:20 ` [PATCH 0/2] BaseTools: minor PatchCheck.py fixes/changes Bob Feng
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=BN6PR11MB0068BF04A8A215A59BE2DC83C96D0@BN6PR11MB0068.namprd11.prod.outlook.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox