LKML Archive on
 help / color / Atom feed
From: "Uwe Kleine-König" <>
To: Thomas Gleixner <>, Joe Perches <>
Cc: Andrew Morton <>,,
	Greg Kroah-Hartman <>,
Subject: [PATCH] scripts/spdxcheck: make python3 compliant
Date: Tue, 23 Oct 2018 09:08:02 +0200
Message-ID: <> (raw)

Without this change the following happens when using Python3 (3.6.6):

	$ echo "GPL-2.0" | python3 scripts/ -
	FAIL: 'str' object has no attribute 'decode'
	Traceback (most recent call last):
	  File "scripts/", line 253, in <module>
	    parser.parse_lines(sys.stdin, args.maxlines, '-')
	  File "scripts/", line 171, in parse_lines
	    line = line.decode(locale.getpreferredencoding(False), errors='ignore')
	AttributeError: 'str' object has no attribute 'decode'

So as the line is already a string, there is no need to decode it and
the line can be dropped.

Signed-off-by: Uwe Kleine-König <>
 scripts/ | 1 -
 1 file changed, 1 deletion(-)

diff --git a/scripts/ b/scripts/
index 839e190bbd7a..5056fb3b897d 100755
--- a/scripts/
+++ b/scripts/
@@ -168,7 +168,6 @@ class id_parser(object):
         self.curline = 0
             for line in fd:
-                line = line.decode(locale.getpreferredencoding(False), errors='ignore')
                 self.curline += 1
                 if self.curline > maxlines:

             reply index

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-23  7:08 Uwe Kleine-König [this message]
2018-11-07 23:32 ` Andrew Morton
2018-11-08  6:22   ` Uwe Kleine-König
2018-11-08  7:59     ` Uwe Kleine-König

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-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

LKML Archive on

Archives are clonable:
	git clone --mirror lkml/git/0.git
	git clone --mirror lkml/git/1.git
	git clone --mirror lkml/git/2.git
	git clone --mirror lkml/git/3.git
	git clone --mirror lkml/git/4.git
	git clone --mirror lkml/git/5.git
	git clone --mirror lkml/git/6.git
	git clone --mirror lkml/git/7.git
	git clone --mirror lkml/git/8.git
	git clone --mirror lkml/git/9.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 lkml lkml/ \
	public-inbox-index lkml

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone