On Wed, Apr 18, 2018 at 6:27 AM Nathan Cutler <ncutler@suse.cz> wrote:
That would be at odds to what Nathan is suggesting though, which is a hard change to Python 3.
Hm, not sure what hard/soft means in this context. For any given script, either it runs with Python 3, or it doesn't. And this is determined by the shebang. (Unless the shebang is omitted, of course.)
I was very surprised to find out that, in SLES and openSUSE, the symlink /usr/bin/python -> /usr/bin/python2 will not be changed even when the migration of the underlying distro to Python 3 is complete.
But then my colleagues explained why that is, and I "saw the light". Since every single script in the distro has to be audited for Python 3 compatibility, anyway, it makes sense to have the shebang be an explicit declaration of said compatibility.
By retaining the symlink at it is, all scripts start out the migration process with an explicit declaration that they are compatible with Python 2. Compatibility with Python 3 is signalled not by saying "it's OK with Python 3, we tried it". It's signalled by changing the shebang.
And this isn't unique to SUSE. Fedora is treating the shebang in the same way, apparently. [2]
Seems that if you only have python3 installed in Fedora31 this is *not* the case. # python --version Python 3.7.5 # /usr/bin/python --version Python 3.7.5 # ls -l /usr/bin/python lrwxrwxrwx. 1 root root 9 Nov 18 00:57 /usr/bin/python -> ./python3 See https://lists.fedoraproject.org/archives/list/devel-announce@lists.fedorapro... and https://fedoraproject.org/wiki/Changes/RetirePython2#The_python27_package "there is no /usr/bin/python" So the two distros are quite divergent in their approach apparently?
It may be true that a given script is fine with Python 3, but as long as the shebang says "python" (i.e. python2), there's no way to really find out, is there? (Barring things like Josh's suggestion of changing the shebang on the fly via a teuthology task/workunit, which is fine if we decide we need a transition period, which it looks like we will.)
Nathan
[1] https://github.com/kubernetes-incubator/external-storage/blob/master/ceph/ce... [2] https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3#.2Fusr.2Fbin.... _______________________________________________ Sepia mailing list Sepia@lists.ceph.com http://lists.ceph.com/listinfo.cgi/sepia-ceph.com
-- Cheers, Brad