From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) by mx.groups.io with SMTP id smtpd.web12.2038.1587483746315366110 for ; Tue, 21 Apr 2020 08:42:26 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@nuviainc-com.20150623.gappssmtp.com header.s=20150623 header.b=WG/MUn/1; spf=pass (domain: nuviainc.com, ip: 209.85.128.48, mailfrom: leif@nuviainc.com) Received: by mail-wm1-f48.google.com with SMTP id x4so4086809wmj.1 for ; Tue, 21 Apr 2020 08:42:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuviainc-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=fVK6faum0RlYJt5Ar10ott1W30/q7tm4LxShQP2YU4Y=; b=WG/MUn/1KW7HeOW1s4mqtjvS7yNETNzkEssr+mQ9OXzNWLU95jdtrIFSLbegwAZkZX NRlPGnaMi/Wqj89YETO5Ixw7nIgz+dhxmBiJQxfDD8GBahRH4Ytt3nliLAYJ6zQ2jy/e K5+HR4G9QpWd7Bne1UGL56BQdYU+z6Al4t91+Coy21htpydzTBg9SwIS33H8C6f8WDtk BmbHbQfdTjZtLlhImJGe99Nmjk+CBxym4XdWmHaS/cfngILAAkitP5xcBmYz4OahcoO9 Iq7EOG/PXuqjk77YGg/qOtMxLiTO73/VTiOCLSky95mU80ZDw5bmEPYEUXsgLIastMVc zT4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=fVK6faum0RlYJt5Ar10ott1W30/q7tm4LxShQP2YU4Y=; b=XTNao76Ic/8/h9ztpfPhadfL0xS1kGRQhmJBpBDVtweZ8eV5NctUJn7A8H7DjMOafv +Lum0q21wbExDQSD97NqKlwJSegxg74ot/pBNnZjYj27Qbizg09Iqaep60P5b5KtPHit aalAXtGQ3+68tXGilrO6Pi1d7YOPXp0eCxz74XQZjaFtLXMrWhq5saC7H74ZXVV97+OW xvM+wNezeWEkC0/9F7aQH91rOVxotD8hfjejduN6mRQasUW94ijhQAovNKo8+oe92ANZ ithWMw7CP3ydq/h+KmQmJNlQQrBOFwMPP93qIbLLSytuqACvW4B9B1kM7icSpHHZwvFD +gmw== X-Gm-Message-State: AGi0Pub5WNU71AI4KKWvcv+vNp3gR5znkGUGzlPJgYzl3U62IfYUBcQp wi8l5oUNE9Fc2KpMQrNBPgtG4bdB+ta+NH1wigCECJB+ycrLFDV4sUwV/baR9inAUcZZcRAuobP 7wrCBkFxxYiPONHzGvfWzRQL3goAVtdkCBK58GZNpryOWiZ2Ylht6926uIdbgmoo= X-Google-Smtp-Source: APiQypIqVLAKkHxVfseUvr4lZ9R07Uu+zw7qBpIXiYm8XcwBvIt972fAvV8TeCNieVZNoSzfBkFKdQ== X-Received: by 2002:a1c:ed18:: with SMTP id l24mr5402571wmh.122.1587483744610; Tue, 21 Apr 2020 08:42:24 -0700 (PDT) Return-Path: Received: from vanye.hemma.eciton.net (cpc92302-cmbg19-2-0-cust304.5-4.cable.virginm.net. [82.1.209.49]) by smtp.gmail.com with ESMTPSA id y20sm4367557wra.79.2020.04.21.08.42.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Apr 2020 08:42:23 -0700 (PDT) From: "Leif Lindholm" To: devel@edk2.groups.io Cc: Bob Feng , Liming Gao Subject: [PATCH 1/1] BaseTools: explicitly import decode_header PatchCheck.py Date: Tue, 21 Apr 2020 16:42:22 +0100 Message-Id: <20200421154222.32485-1-leif@nuviainc.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Cc: Liming Gao Signed-off-by: Leif Lindholm --- 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