public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Leif Lindholm" <leif@nuviainc.com>
To: devel@edk2.groups.io
Cc: Bob Feng <bob.c.feng@intel.com>, Liming Gao <liming.gao@intel.com>
Subject: [PATCH 1/1] BaseTools: explicitly import decode_header PatchCheck.py
Date: Tue, 21 Apr 2020 16:42:22 +0100	[thread overview]
Message-ID: <20200421154222.32485-1-leif@nuviainc.com> (raw)

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 decode_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>
---

I'm pretty sure this used to work with python 2,
but I'm not sure when it stopped...

 BaseTools/Scripts/PatchCheck.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/BaseTools/Scripts/PatchCheck.py b/BaseTools/Scripts/PatchCheck.py
index 13da6967785d..675ce273e830 100755
--- a/BaseTools/Scripts/PatchCheck.py
+++ b/BaseTools/Scripts/PatchCheck.py
@@ -19,6 +19,8 @@ import re
 import subprocess
 import sys
 
+from email.header import decode_header
+
 class Verbose:
     SILENT, ONELINE, NORMAL = range(3)
     level = NORMAL
-- 
2.20.1


             reply	other threads:[~2020-04-21 15:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-21 15:42 Leif Lindholm [this message]
2020-04-27 15:37 ` [edk2-devel] [PATCH 1/1] BaseTools: explicitly import decode_header PatchCheck.py Liming Gao
2020-04-27 15:56   ` Leif Lindholm
2020-04-28 11:35     ` 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=20200421154222.32485-1-leif@nuviainc.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