Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3056992imu; Mon, 19 Nov 2018 09:59:57 -0800 (PST) X-Google-Smtp-Source: AJdET5el6KiCZXogaRFxt2fNBEU+NEmwRPqanCtu9/B0n1WDs6Cj0XDBoxA2doN0BkDZOEgbUVhC X-Received: by 2002:a17:902:bd4a:: with SMTP id b10mr23437039plx.232.1542650397520; Mon, 19 Nov 2018 09:59:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542650397; cv=none; d=google.com; s=arc-20160816; b=06m0f/KgftzaVDBlo3StOf00Ll0NWPwYq7PbzCcaEGcUAxR2ad6ZD5kUEPfViAvdU5 Y+mtTC298V/sg2VuzBbcA2G5MyLLEKJe5l6XpdvUhf1VgoUixPslReGwjneMe71ruR9A W8bmXAtZAkX0VUWcacpcRZ2RaH6X2GHVPIgIOOYI9XCFFvVn+uQD3SUdjqr747LK0Tx2 wwZNln8vZsJcNeazvKEFnJ+2S5xxAgWvBk4HpT+s/qpKHHoFgeYLTisBWVak7kImlvMI f6gmd0x9hWodojYoSohox74+3Gghuc1bIFiAIQ8hOVqJVeVfUGelROQ0HBqI4sxagle5 D5qw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=qBR+1l9eWKiM/l80dKffmQjfXOVCW80uUUEGc0r1IjM=; b=Wi2tHAfs0CbmWH4Jp2sWiM+u1RX0uN0j3ExPORnG+WnOankO6H4gLyfwBhXmPLRXHG G/jE1NoEIeNum3iaWggypqRDkZl76fWnqRDIPDzeh6ceHX8USnakXsuMPpe0MOtqSSg2 khu3wjPu+OjGbpba1HUsBC3UUUKk/MdXbLUzPdGOpfqqxvno6XUREqbFJNCst6SdZ2ZF 5ccIVXuv6dUGAtT8nWa7IcgSzLlsz6ZROGr72HumPk3pgXmUfHyNaUnkJ2Z1vPQDT87j 8UwtxaLFpqY9/dRqbsNM+pruVmsl4Y42MH40G3rL9V/sbhy39zhc0j8ewwB1YPqokfiQ yIyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=yYjjYKAO; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l132-v6si30033038pfc.263.2018.11.19.09.59.42; Mon, 19 Nov 2018 09:59:57 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=yYjjYKAO; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732287AbeKTDBy (ORCPT + 99 others); Mon, 19 Nov 2018 22:01:54 -0500 Received: from mail.kernel.org ([198.145.29.99]:33992 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730719AbeKTDBx (ORCPT ); Mon, 19 Nov 2018 22:01:53 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 57E90208E4; Mon, 19 Nov 2018 16:37:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1542645464; bh=r827Ll1RwaDZefLeRQcMWuhjUwkvetP+bdBNQxghb4g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yYjjYKAOrSMhKgEnDHq81ROrIudfsJ+01tkkJ5T+TM62nfNK5M9u19ysOUMNzfPRZ V83cL1mMFhh7EA82nbmcruqxuO9aj7XrPRgSQcJHgriGA/286rsD0hrduKpw0/yF8C hmzJ52HQSVFGEaEl+0SsDLHM501YGSV2pbu/qBF8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= , Thomas Gleixner , Joe Perches , Andrew Morton , Linus Torvalds Subject: [PATCH 4.19 172/205] scripts/spdxcheck.py: make python3 compliant Date: Mon, 19 Nov 2018 17:27:59 +0100 Message-Id: <20181119162640.560650734@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181119162616.586062722@linuxfoundation.org> References: <20181119162616.586062722@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ From: Uwe Kleine-König commit 6f4d29df66acd49303a99025046b85cabe7aa17a upstream. Without this change the following happens when using Python3 (3.6.6): $ echo "GPL-2.0" | python3 scripts/spdxcheck.py - FAIL: 'str' object has no attribute 'decode' Traceback (most recent call last): File "scripts/spdxcheck.py", line 253, in parser.parse_lines(sys.stdin, args.maxlines, '-') File "scripts/spdxcheck.py", 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. /usr/bin/python on Arch is Python 3. So this would indeed be worth going into 4.19. Link: http://lkml.kernel.org/r/20181023070802.22558-1-u.kleine-koenig@pengutronix.de Signed-off-by: Uwe Kleine-König Cc: Thomas Gleixner Cc: Joe Perches Cc: Greg Kroah-Hartman Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman --- scripts/spdxcheck.py | 1 - 1 file changed, 1 deletion(-) --- a/scripts/spdxcheck.py +++ b/scripts/spdxcheck.py @@ -168,7 +168,6 @@ class id_parser(object): self.curline = 0 try: for line in fd: - line = line.decode(locale.getpreferredencoding(False), errors='ignore') self.curline += 1 if self.curline > maxlines: break