Fedora 28 - python warnings

Richard Laager rlaager at wiktel.com
Fri May 11 23:49:53 UTC 2018

On 05/11/2018 06:17 PM, Gary E. Miller via devel wrote:
> Per the Python doc:
> "The default Python will be located and used."

You're quoting from this, which you linked:

That's for Windows, which is talking about a Windows-specific launcher
executable (py.exe) that fires based on file associations (i.e. file
extensions). It then parses the Unix-style shebang line, if present, and
executes the actual python interpreter. None of this has anything to do
with Python on *nix.

On *nix, by default, python is Python 2, and python3 is Python 3, as
described here (which I already linked):

I don't know how to find ebuild sources (short of installing Gentoo) to
verify this, but I strongly suspect that your python-exec2c is coming
from something other than the Python source tree. That doesn't make it
wrong or a bad thing, though. It's perfectly fine that Gentoo operates
the way that it does.

It's also perfectly fine that Debian does what it does, which is to have
python & python2 be Python 2 and python3 be Python 3. This is exactly
the default for an out-of-the-box stock upstream Python install, as I
have shown.

It is also perfectly fine that NTPsec uses whatever is installed as
python. It will get some version of Python. That version will most
likely be Python 2, but it may be Python 3 (e.g. see Gentoo). There's
nothing wrong with NTPsec making this choice.

It is _not_ fine for you to claim that Debian is non-standard or broken
in this regard. That's simply not true. It is following what upstream
does by default.

The original question in this thread is basically:

1) A distro has:
   /usr/bin/python  = Python 2
   /usr/bin/python2 = Python 2
   /usr/bin/python3 = Python 3

2) That distro wants to transition applications to use Python 3.

3) That distro is not going to change /usr/bin/python to be Python 3, as
that would break existing code that is not Python 3 compatible. Even if
everything in the distro was ready, users may still have custom scripts
that have not been ported to Python 3 that run under /usr/bin/python.

3) Therefore, applications need to explicitly use python3 rather than
python as the interpreter name.

4) NTPsec is one such application.

5) How should this be implemented?

The original question was about Fedora, but Debian is in the same boat.
So I suggested how I was solving the problem.

An alternative would be for NTPsec to support a waf option and
substitute it into the shebang line. That has been discussed and so far
rejected. If that's not an option, and a distro goal is to use
explicitly versioned interpreter names, then patching it is the only
option left.


-------------- 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/08277991/attachment.bin>

More information about the devel mailing list