2021-01-21 17:22:02

by Scott Branden

[permalink] [raw]
Subject: [PATCH] diffconfig: use python3 instead of python in Shebang line

Use python3 instead of python in diffconfig Shebang line.
python2 was sunset January 1, 2000 and environments do not need
to support python any more.

Fixes: b24413180f56 ("tweewide: Fix most Shebang lines")
Signed-off-by: Scott Branden <[email protected]>
---
scripts/diffconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/diffconfig b/scripts/diffconfig
index 627eba5849b5..d5da5fa05d1d 100755
--- a/scripts/diffconfig
+++ b/scripts/diffconfig
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# SPDX-License-Identifier: GPL-2.0
#
# diffconfig - a tool to compare .config files.
--
2.17.1


2021-01-21 20:28:43

by Masahiro Yamada

[permalink] [raw]
Subject: Re: [PATCH] diffconfig: use python3 instead of python in Shebang line

On Fri, Jan 22, 2021 at 2:17 AM Scott Branden
<[email protected]> wrote:
>
> Use python3 instead of python in diffconfig Shebang line.
> python2 was sunset January 1, 2000 and environments do not need
> to support python any more.
>
> Fixes: b24413180f56 ("tweewide: Fix most Shebang lines")
> Signed-off-by: Scott Branden <[email protected]>
> ---
> scripts/diffconfig | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/scripts/diffconfig b/scripts/diffconfig
> index 627eba5849b5..d5da5fa05d1d 100755
> --- a/scripts/diffconfig
> +++ b/scripts/diffconfig
> @@ -1,4 +1,4 @@
> -#!/usr/bin/env python
> +#!/usr/bin/env python3
> # SPDX-License-Identifier: GPL-2.0
> #
> # diffconfig - a tool to compare .config files.
> --
> 2.17.1
>

Just from curiosity, what problem is this solving?

Is there a distribution where 'python' does not exist,
but 'python3' does ?


--
Best Regards
Masahiro Yamada

2021-01-21 20:33:34

by Andy Shevchenko

[permalink] [raw]
Subject: Re: [PATCH] diffconfig: use python3 instead of python in Shebang line

On Thu, Jan 21, 2021 at 10:28 PM Masahiro Yamada <[email protected]> wrote:
>
> On Fri, Jan 22, 2021 at 2:17 AM Scott Branden
> <[email protected]> wrote:
> >
> > Use python3 instead of python in diffconfig Shebang line.
> > python2 was sunset January 1, 2000 and environments do not need
> > to support python any more.

> Just from curiosity, what problem is this solving?
>
> Is there a distribution where 'python' does not exist,
> but 'python3' does ?

Yes. Called surprise surprise Debian
An it's a rare case when I agree with them.


--
With Best Regards,
Andy Shevchenko

2021-01-21 20:39:44

by Andy Shevchenko

[permalink] [raw]
Subject: Re: [PATCH] diffconfig: use python3 instead of python in Shebang line

On Thu, Jan 21, 2021 at 10:31 PM Andy Shevchenko
<[email protected]> wrote:
>
> On Thu, Jan 21, 2021 at 10:28 PM Masahiro Yamada <[email protected]> wrote:
> >
> > On Fri, Jan 22, 2021 at 2:17 AM Scott Branden
> > <[email protected]> wrote:
> > >
> > > Use python3 instead of python in diffconfig Shebang line.
> > > python2 was sunset January 1, 2000 and environments do not need
> > > to support python any more.
>
> > Just from curiosity, what problem is this solving?
> >
> > Is there a distribution where 'python' does not exist,
> > but 'python3' does ?
>
> Yes. Called surprise surprise Debian
> An it's a rare case when I agree with them.

For the record, you seems haven't noticed:
https://lkml.org/lkml/2020/12/9/446

--
With Best Regards,
Andy Shevchenko

2021-01-21 20:48:00

by Scott Branden

[permalink] [raw]
Subject: Re: [PATCH] diffconfig: use python3 instead of python in Shebang line

Hi Masahiro,

On 2021-01-21 12:25 p.m., Masahiro Yamada wrote:
> On Fri, Jan 22, 2021 at 2:17 AM Scott Branden
> <[email protected]> wrote:
>> Use python3 instead of python in diffconfig Shebang line.
>> python2 was sunset January 1, 2000 and environments do not need
>> to support python any more.
>>
>> Fixes: b24413180f56 ("tweewide: Fix most Shebang lines")
>> Signed-off-by: Scott Branden <[email protected]>
>> ---
>> scripts/diffconfig | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/scripts/diffconfig b/scripts/diffconfig
>> index 627eba5849b5..d5da5fa05d1d 100755
>> --- a/scripts/diffconfig
>> +++ b/scripts/diffconfig
>> @@ -1,4 +1,4 @@
>> -#!/usr/bin/env python
>> +#!/usr/bin/env python3
>> # SPDX-License-Identifier: GPL-2.0
>> #
>> # diffconfig - a tool to compare .config files.
>> --
>> 2.17.1
>>
> Just from curiosity, what problem is this solving?
It is solving the problem that python is long past its life:
https://www.python.org/doc/sunset-python-2/

The 5.11-rc kernel diffconfig doesn't work now due
to the /usr/bin/python change to /usr/bin/env python.

Could we please ensure this makes it into 5.11 and/or
maintains the FIxes tag if it does not?
>
> Is there a distribution where 'python' does not exist,
> but 'python3' does ?
Yes, Python is finally being removed from some distributions
and has already been done so from my yocto builds where
I detected the problem.
>
Thanks,
Scott

2021-01-21 21:16:33

by Scott Branden

[permalink] [raw]
Subject: Re: [PATCH] diffconfig: use python3 instead of python in Shebang line

Hi Andy,

On 2021-01-21 12:35 p.m., Andy Shevchenko wrote:
> On Thu, Jan 21, 2021 at 10:31 PM Andy Shevchenko
> <[email protected]> wrote:
>> On Thu, Jan 21, 2021 at 10:28 PM Masahiro Yamada <[email protected]> wrote:
>>> On Fri, Jan 22, 2021 at 2:17 AM Scott Branden
>>> <[email protected]> wrote:
>>>> Use python3 instead of python in diffconfig Shebang line.
>>>> python2 was sunset January 1, 2000 and environments do not need
>>>> to support python any more.
>>> Just from curiosity, what problem is this solving?
>>>
>>> Is there a distribution where 'python' does not exist,
>>> but 'python3' does ?
>> Yes. Called surprise surprise Debian
>> An it's a rare case when I agree with them.
> For the record, you seems haven't noticed:
> https://lkml.org/lkml/2020/12/9/446
It doesn't look like your change made it into 5.11-rc but I think it should be added?

2021-01-21 22:30:30

by Masahiro Yamada

[permalink] [raw]
Subject: Re: [PATCH] diffconfig: use python3 instead of python in Shebang line

On Fri, Jan 22, 2021 at 5:35 AM Andy Shevchenko
<[email protected]> wrote:
>
> On Thu, Jan 21, 2021 at 10:31 PM Andy Shevchenko
> <[email protected]> wrote:
> >
> > On Thu, Jan 21, 2021 at 10:28 PM Masahiro Yamada <[email protected]> wrote:
> > >
> > > On Fri, Jan 22, 2021 at 2:17 AM Scott Branden
> > > <[email protected]> wrote:
> > > >
> > > > Use python3 instead of python in diffconfig Shebang line.
> > > > python2 was sunset January 1, 2000 and environments do not need
> > > > to support python any more.
> >
> > > Just from curiosity, what problem is this solving?
> > >
> > > Is there a distribution where 'python' does not exist,
> > > but 'python3' does ?
> >
> > Yes. Called surprise surprise Debian
> > An it's a rare case when I agree with them.
>
> For the record, you seems haven't noticed:
> https://lkml.org/lkml/2020/12/9/446


Ohh, I missed it.
I know many patches are falling into a crack.

To respect the first submitter, and it solves
another file, I just picked up Andy's one.


I use Ubuntu, where /usr/bin/python is a symlink
to /usr/bin/python3.

I just booted Debian in a VM, and confirmed
/usr/bin/python no longer exists.

Thanks for the explanation.




--
Best Regards
Masahiro Yamada

2021-01-22 04:37:44

by Joe Perches

[permalink] [raw]
Subject: Re: [PATCH] diffconfig: use python3 instead of python in Shebang line

On Fri, 2021-01-22 at 05:25 +0900, Masahiro Yamada wrote:
> On Fri, Jan 22, 2021 at 2:17 AM Scott Branden
> <[email protected]> wrote:
> >
> > Use python3 instead of python in diffconfig Shebang line.
> > python2 was sunset January 1, 2000 and environments do not need
> > to support python any more.

python2 was sunset Jan 1, 2020, not 20 years before that.

https://www.python.org/doc/sunset-python-2/


2021-01-22 10:36:13

by Andy Shevchenko

[permalink] [raw]
Subject: Re: [PATCH] diffconfig: use python3 instead of python in Shebang line

On Fri, Jan 22, 2021 at 12:07 AM Masahiro Yamada <[email protected]> wrote:
> On Fri, Jan 22, 2021 at 5:35 AM Andy Shevchenko
> <[email protected]> wrote:
> > On Thu, Jan 21, 2021 at 10:31 PM Andy Shevchenko
> > <[email protected]> wrote:

...

> > For the record, you seems haven't noticed:
> > https://lkml.org/lkml/2020/12/9/446
>
>
> Ohh, I missed it.
> I know many patches are falling into a crack.
>
> To respect the first submitter, and it solves
> another file, I just picked up Andy's one.

Thanks!

> I use Ubuntu, where /usr/bin/python is a symlink
> to /usr/bin/python3.

JFYI: on some forums / mailing lists it was discussed and Python
people are against this decision in order to prevent python2 script
breakage on Python3 platform due to Python language nature (you may
not notice problem until you got a traceback at some point).

> I just booted Debian in a VM, and confirmed
> /usr/bin/python no longer exists.
>
> Thanks for the explanation.

You're welcome!

--
With Best Regards,
Andy Shevchenko

2021-01-22 15:56:41

by Joe Perches

[permalink] [raw]
Subject: Re: [PATCH] diffconfig: use python3 instead of python in Shebang line

On Fri, 2021-01-22 at 07:06 +0900, Masahiro Yamada wrote:
> I use Ubuntu, where /usr/bin/python is a symlink
> to /usr/bin/python3.

Odd, here:

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.10
Release: 20.10
Codename: groovy

$ ls /usr/bin/python -la
lrwxrwxrwx 1 root root 7 Apr 15 2020 /usr/bin/python -> python2



2021-01-22 17:32:01

by Scott Branden

[permalink] [raw]
Subject: Re: [PATCH] diffconfig: use python3 instead of python in Shebang line



On 2021-01-21 6:18 p.m., Joe Perches wrote:
> On Fri, 2021-01-22 at 05:25 +0900, Masahiro Yamada wrote:
>> On Fri, Jan 22, 2021 at 2:17 AM Scott Branden
>> <[email protected]> wrote:
>>> Use python3 instead of python in diffconfig Shebang line.
>>> python2 was sunset January 1, 2000 and environments do not need
>>> to support python any more.
> python2 was sunset Jan 1, 2020, not 20 years before that.
>
> https://www.python.org/doc/sunset-python-2/
With the past year: Jan 1, 2020 seems about 20 years ago.
>
>

2021-01-22 18:03:07

by Joe Perches

[permalink] [raw]
Subject: Re: [PATCH] diffconfig: use python3 instead of python in Shebang line

On Sat, 2021-01-23 at 02:16 +0900, Masahiro Yamada wrote:
> On Sat, Jan 23, 2021 at 12:51 AM Joe Perches <[email protected]> wrote:
> >
> > On Fri, 2021-01-22 at 07:06 +0900, Masahiro Yamada wrote:
> > > I use Ubuntu, where /usr/bin/python is a symlink
> > > to /usr/bin/python3.
> >
> > Odd, here:
> >
> > $ lsb_release -a
> > No LSB modules are available.
> > Distributor ID: Ubuntu
> > Description: Ubuntu 20.10
> > Release: 20.10
> > Codename: groovy
> >
> > $ ls /usr/bin/python -la
> > lrwxrwxrwx 1 root root 7 Apr 15 2020 /usr/bin/python -> python2
>
> Hmm, presumably I changed the symlink path by myself
> although I do not remember... Sorry for confusion.

Or maybe it's because my system has only been upgraded since
about Ubuntu 8.04... Maybe it's time for a fresh reinstall..

I believe that Ubuntu now only installs python3 since 18.04

https://wiki.ubuntu.com/BionicBeaver/ReleaseNotes

Other base system changes since 16.04 LTS

The gpg binary is provided by gnupg2

For new installs, a swap file will be used by default instead of a swap partition.

Python 2 is no longer installed by default. Python 3 has been updated to 3.6. This is the last LTS release to include Python 2 in main.



2021-01-22 18:17:23

by Masahiro Yamada

[permalink] [raw]
Subject: Re: [PATCH] diffconfig: use python3 instead of python in Shebang line

On Sat, Jan 23, 2021 at 12:51 AM Joe Perches <[email protected]> wrote:
>
> On Fri, 2021-01-22 at 07:06 +0900, Masahiro Yamada wrote:
> > I use Ubuntu, where /usr/bin/python is a symlink
> > to /usr/bin/python3.
>
> Odd, here:
>
> $ lsb_release -a
> No LSB modules are available.
> Distributor ID: Ubuntu
> Description: Ubuntu 20.10
> Release: 20.10
> Codename: groovy
>
> $ ls /usr/bin/python -la
> lrwxrwxrwx 1 root root 7 Apr 15 2020 /usr/bin/python -> python2
>
>
>

Hmm, presumably I changed the symlink path by myself
although I do not remember... Sorry for confusion.





--
Best Regards
Masahiro Yamada