public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Carsey, Jaben" <jaben.carsey@intel.com>
To: "Bi, Dandan" <dandan.bi@intel.com>,
	"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Cc: "Gao, Liming" <liming.gao@intel.com>,
	"Zhu, Yonghong" <yonghong.zhu@intel.com>
Subject: Re: [patch] BaseTools/PatchCheck.py: Fix error when run with Python3
Date: Wed, 5 Sep 2018 15:02:00 +0000	[thread overview]
Message-ID: <CB6E33457884FA40993F35157061515CA412FF85@FMSMSX103.amr.corp.intel.com> (raw)
In-Reply-To: <20180905072113.73680-1-dandan.bi@intel.com>

Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>

> -----Original Message-----
> From: Bi, Dandan
> Sent: Wednesday, September 05, 2018 12:21 AM
> To: edk2-devel@lists.01.org
> Cc: Gao, Liming <liming.gao@intel.com>; Carsey, Jaben
> <jaben.carsey@intel.com>; Zhu, Yonghong <yonghong.zhu@intel.com>
> Subject: [patch] BaseTools/PatchCheck.py: Fix error when run with Python3
> Importance: High
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1145
> 
> Currently run PatchCheck.py with Python3 will meet
> following error:
> .....
> File "PatchCheck.py", line 554, in run_git
> return Result[0].decode('utf-8', 'ignore') if Result[0] and
> Result[0].find("fatal")!=0 else None
> TypeError: a bytes-like object is required, not 'str'
> 
> This issue was introduce by commit:5ac4548cdf654.
> 
> This patch is to convert the str object of "fatal" to
> byte object to fix this failure.
> 
> Cc: Liming Gao <liming.gao@intel.com>
> Cc: Jaben Carsey <jaben.carsey@intel.com>
> Cc: Yonghong Zhu <yonghong.zhu@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Dandan Bi <dandan.bi@intel.com>
> ---
>  BaseTools/Scripts/PatchCheck.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/BaseTools/Scripts/PatchCheck.py
> b/BaseTools/Scripts/PatchCheck.py
> index 96b3cdf1fd..0b580f3b31 100755
> --- a/BaseTools/Scripts/PatchCheck.py
> +++ b/BaseTools/Scripts/PatchCheck.py
> @@ -549,11 +549,11 @@ class CheckGitCommits:
>          cmd += args
>          p = subprocess.Popen(cmd,
>                       stdout=subprocess.PIPE,
>                       stderr=subprocess.STDOUT)
>          Result = p.communicate()
> -        return Result[0].decode('utf-8', 'ignore') if Result[0] and
> Result[0].find("fatal")!=0 else None
> +        return Result[0].decode('utf-8', 'ignore') if Result[0] and
> Result[0].find(b"fatal")!=0 else None
> 
>  class CheckOnePatchFile:
>      """Performs a patch check for a single file.
> 
>      stdin is used when the filename is '-'.
> --
> 2.14.3.windows.1



      reply	other threads:[~2018-09-05 15:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-05  7:21 [patch] BaseTools/PatchCheck.py: Fix error when run with Python3 Dandan Bi
2018-09-05 15:02 ` Carsey, Jaben [this message]

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=CB6E33457884FA40993F35157061515CA412FF85@FMSMSX103.amr.corp.intel.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