lkml.org 
[lkml]   [2018]   [Nov]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] scripts/spdxcheck: make python3 compliant
Hello Andrew,

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").

Best regards
Uwe

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

\
 
 \ /
  Last update: 2018-11-08 07:22    [W:0.042 / U:1.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site