[Starlingx-discuss] MultiOS: call of python via #!/usr/bin/env

Jeremy Stanley fungi at yuggoth.org
Wed Sep 11 14:24:54 UTC 2019


On 2019-09-11 16:05:15 +0200 (+0200), Dominig ar Foll (Intel Open Source) wrote:
[...]
> Remains to decide if we call directly python2 or just python.
> For me enforcing python2 by the OBS build system is easy (a simple
> "prefer: python2" statement in "project config" , so I would be happy to
> not enforce the pythin release on a per packet basis, but the people
> working on Pythin3 support may have a different opinion that I would
> like to know.

The "python" (or "python2") and "python3" executables are
interpreters for different programming languages. General consensus
is that making a "python3" interpreter available as "python" is
incorrect. A few distros have gone against this advice (notably Arch
Linux), and have created a fair amount of pain for software authors
as a result. I recommend using either #!/usr/bin/python2 or
#!/usr/bin/python3 for clarity, and avoiding #!/usr/bin/python in
new scripts if possible (but certainly never put #!/usr/bin/python
in a Python-3.x-only script and expect the underlying system to
provide a python3-compatible interpreter at /usr/bin/python, that's
just asking for trouble).
-- 
Jeremy Stanley
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 963 bytes
Desc: not available
URL: <http://lists.starlingx.io/pipermail/starlingx-discuss/attachments/20190911/c648d1a4/attachment.sig>


More information about the Starlingx-discuss mailing list