LKML Archive on lore.kernel.org
 help / color / Atom feed
From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Joe Perches <joe@perches.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	linux-kernel@vger.kernel.org, kernel@pengutronix.de
Subject: Re: [PATCH] scripts/spdxcheck: make python3 compliant
Date: Thu, 8 Nov 2018 08:59:46 +0100
Message-ID: <20181108075946.uhcjir4rh4kpg6nx@pengutronix.de> (raw)
In-Reply-To: <20181108062200.ytkezavtcaypdlat@pengutronix.de>

Hello,

On Thu, Nov 08, 2018 at 07:22:00AM +0100, Uwe Kleine-König wrote:
> On Wed, Nov 07, 2018 at 03:32:51PM -0800, Andrew Morton wrote:
> > On Tue, 23 Oct 2018 09:08:02 +0200 Uwe Kleine-König <u.kleine-koenig@pengutronix.de> wrote:
> > 
> > > 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 <module>
> > > 	    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.
> > 
> > I suppose people might want to run spdxcheck.py against (say) 4.19.x
> > using python3.  So I'll add a cc:stable here, OK?
> 
> Not sure if people call spdxcheck.py stand-alone. checkpatch.pl calls it
> using "python scripts/spdxcheck.py" which AFAICT should still be python2
> on all machines. The shebang-line also uses "python" and not "python3".
> 
> So for now this is only cosmetic (unless there are distros that install
> Python 3 as "python").

I just learned that /usr/bin/python on Arch is Python 3. So this would
indeed be worth to go into 4.19.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

      reply index

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-23  7:08 Uwe Kleine-König
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 [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-all 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=20181108075946.uhcjir4rh4kpg6nx@pengutronix.de \
    --to=u.kleine-koenig@pengutronix.de \
    --cc=akpm@linux-foundation.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=joe@perches.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tglx@linutronix.de \
    /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

LKML Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/lkml/0 lkml/git/0.git
	git clone --mirror https://lore.kernel.org/lkml/1 lkml/git/1.git
	git clone --mirror https://lore.kernel.org/lkml/2 lkml/git/2.git
	git clone --mirror https://lore.kernel.org/lkml/3 lkml/git/3.git
	git clone --mirror https://lore.kernel.org/lkml/4 lkml/git/4.git
	git clone --mirror https://lore.kernel.org/lkml/5 lkml/git/5.git
	git clone --mirror https://lore.kernel.org/lkml/6 lkml/git/6.git
	git clone --mirror https://lore.kernel.org/lkml/7 lkml/git/7.git
	git clone --mirror https://lore.kernel.org/lkml/8 lkml/git/8.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/ https://lore.kernel.org/lkml \
		linux-kernel@vger.kernel.org
	public-inbox-index lkml

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-kernel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git