4 ms·
To quote from the abstract of PEP394: > * for the time being, all distributions should ensure that python refers to the same target as python2 . > * however,
by Dunedan 9y ago
To quote from the abstract of PEP394:
> * for the time being, all distributions should ensure that python refers to the same target as python2 .
> * however, end users should be aware that python refers to python3 on at least Arch Linux (that change is what prompted the creation of this PEP), so python should be used in the shebang line only for scripts that are source compatible with both Python 2 and 3.
> * in preparation for an eventual change in the default version of Python, Python 2 only scripts should either be updated to be source compatible with Python 3 or else to use python2 in the shebang line.
- JoshTriplett 9y agoThat's just a recognition of the existence of that particular quirk of Arch, and that people may need to cope with that. It's remarkably painful, in practice, to deal with the one special distribution that makes "#!/usr/bin/python" do the wrong thing. And unfortunately, some other distributions don't have a "python2" or "python3" binary, making it painful to write portable scripts; you can't write "#!/usr/bin/python2" or "#!/usr/bin/python3" and expect it to work on every distribution out there. As mentioned, Debian is working on migrating scripts to support Python 3, and doing so using /usr/bin/python3 , which already appears in the shebang of a large number of Debian's Python programs.
- LukaD 9y agoArch has had python2 and python3 binaries for a long time. /usr/bin/python2 has been there since at least 2010 https://git.archlinux.org/svntogit/packages.git/commit/trunk?h=packages/python2&id=616713b07507e4e07547d596686d30d633d4d1d3 https://git.archlinux.org/svntogit/packages.git/commit/trunk...
- 0xelectron 9y agoYes but not the other distributions. Which makes it difficult to write portable scripts.