Fedora 28 - python warnings

Richard Laager rlaager at wiktel.com
Fri May 11 21:34:55 UTC 2018


On 05/11/2018 02:54 PM, Gary E. Miller via devel wrote:
>> That is, I can use "/usr/bin/env perl", and it doesn't
>> matter whether my "perl" is in /usr/bin, /usr/local/bin, /usr/sbin,
>> /bin, or whatever. As long as it is in the $PATH, env finds it.
> 
> Yup!  Now you start to get it!  There is never an executablecalled
> 'perl' only a pointer to the current perl.

That's certainly not true everywhere. I have an out-of-the-box Perl
setup from Ubuntu and I have an actual perl at /usr/bin/perl:

$ which perl
/usr/bin/perl

$ ls -l /usr/bin/perl
-rwxr-xr-x 2 root root 1.9M Apr  5 07:48 /usr/bin/perl

>> You are proposing that:
>>   /usr/bin/env python foo
>> be equivalent to (for example):
>>   /usr/bin/python3 foo
> 
> Uh, no.  Please do not put words in my mouth.

I'm not putting words in your mouth. That's literally what you said:

 On 05/11/2018 12:00 PM, Gary E. Miller via devel wrote:
 > Better to fix '/usr/bin/env python' to return python3
 > (as it should) and then all properly written python programs will
 > work.

You very clearly stated that "/usr/bin/env python" should run ("return")
python3. That is the position I am responding to.

My /usr/bin/env from GNU coreutils is behaving as env always has, is not
broken, and does not need to be fixed. When I pass it "python", it runs
something named "python", or if that does not exist, gives an error.

>> You have said your system DOES behave that way.
> 
> Uh, sort of, you are missing the details...

Your env behaves the same way as mine, which is the same way env has
behaved for decades.

> $ which python
> /usr/bin/python

This contracts what you said here:

On 05/11/2018, 13:25:35 PM, Gary E. Miller via devel wrote:
 > Actually, on Gentoo, and most other distro I use: NOTHING is
 > installed as 'python'.

You actually do have something installed as python.

> $ ls -l /usr/bin/python
> lrwxrwxrwx 1 root root 13 May 11 08:36 /usr/bin/python -> python-exec2c

You have a symlink to python-exec2c installed as python.

> $ python --version
> Python 2.7.14
> 
> $ /usr/bin/env python --version
> Python 2.7.14

So your /usr/bin/env python runs python, exactly as expected. It does
not run python3 as you proposed it should.

Your python is a symlink to python-exec2c which then implements some
policy as to which python to run, which might be Python 2 or might be
Python 3. That is very much not the same thing as "fix[ing] /usr/bin/env
python to [run] python3" as you proposed.

If your argument is actually, "Distros should having a Python selector
utility in place as /usr/bin/python, similar to what Gentoo does.",
that's a bit different. I'm happy to discuss that for a bit once we
agree that my /usr/bin/env is not broken.

On 05/11/2018 02:58 PM, Gary E. Miller via devel wrote:
> BTW, you asked my results for some sh commands.  What are your results?

$ which python
/usr/bin/python

$ /usr/bin/env python --version
Python 2.7.12

$ python --version
Python 2.7.12

$ ls -l /usr/bin/python
lrwxrwxrwx 1 root root 9 Nov 23 18:52 /usr/bin/python -> python2.7

$ ls -l /usr/bin/python2.7
-rwxr-xr-x 1 root root 3.4M Dec  4 12:14 /usr/bin/python2.7

-- 
Richard

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 455 bytes
Desc: OpenPGP digital signature
URL: <https://lists.ntpsec.org/pipermail/devel/attachments/20180511/b5f53b06/attachment.bin>


More information about the devel mailing list