Fedora 28 - python warnings

Gary E. Miller gem at rellim.com
Fri May 11 19:54:04 UTC 2018


Yo Richard!

On Fri, 11 May 2018 14:23:04 -0500
Richard Laager via devel <devel at ntpsec.org> wrote:

> To recap my understanding, and what your links say, /usr/bin/env
> performs two functions:

Bad understanding.  Try to use the words on the page:

    "The key benefit of this is that a single launcher can support
    multiple Python versions at the same time depending on the contents
    of the first line."

Note the phrase: "key benefit".  I would say that places it above the
two, of many, aspects you mention.

> 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.  Now replace 'perl' with
'python' in the previsou sentence.

> 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 choosing mine
more carefully than you are choosing for me.

> You have said your system DOES behave that way.

Uh, sort of, you are missing the details...

> Can you give the results of the following commands:

Even better:

$ which python
/usr/bin/python

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

$ python --version
Python 2.7.14

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

$ eselect python set 3

$ which python
/usr/bin/python

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

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

$ python --version
Python 3.6.5

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

$ eselect list python
!!! Error: Can't load module list
exiting

$ eselect list python list
!!! Error: Can't load module list
exiting

$ eselect  python list
Available Python interpreters, in order of preference:
  [1]   python3.6
  [2]   python2.7
  [3]   python3.4
  [4]   python3.5 (fallback)
  [5]   pypy (fallback)

Noew grok that.  Notice, that as specified in the Python doc, /usr/bin/python
is not, and never should be, the actualy python interpreter.  As
specified in the Python doc, it is a launcher.

Reread the Python doc.  I have often bashed the Python doc, but in this
case IMHO they are spot on.

RGDS
GARY
---------------------------------------------------------------------------
Gary E. Miller Rellim 109 NW Wilmington Ave., Suite E, Bend, OR 97703
	gem at rellim.com  Tel:+1 541 382 8588

	    Veritas liberabit vos. -- Quid est veritas?
    "If you can’t measure it, you can’t improve it." - Lord Kelvin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://lists.ntpsec.org/pipermail/devel/attachments/20180511/3c67ffc2/attachment.bin>


More information about the devel mailing list