On Tue, 23 Aug 2016 13:54, Christian Boltz wrote:
Hello,
Am Montag, 22. August 2016, 15:23:08 CEST schrieb jan matejek:
I like this idea. I'll see what I can do about making it work. ISTM you basically only need to substitute the correct executable? Possibly mess with what "env python" returns, but OTOH perhaps we should run the scripts with an explicit interpreter, and consider "env python" a bug... which we've been quietly doing since forever.
You are raising an interesting detail here - shoud python scripts have #!/usr/bin/python3 or #!/usr/bin/env python3 ?
Both work, but I wonder if (and why) one of them is "better". Can you give some insights, please?
(I used python3 for the example, but the same question applies to python 2.)
+1 for direct use (#!/usr/bin/python3 or #!/usr/bin/python2) Details: Well, theoretically you could define a variable "python3" with a value of, say "/opt/python3-head/python" and mark that variable for export. With "env python3" the content of the variable "python3" would be prefered over the content of the variable "PATH" (see "which python3"). IMHO, for programs that come from distro-core repos (e.g. Version-oss and Version-update) a "direct" call (#!/usr/bin/python3) scould be prefered, esp. for system-tools. For out-lying "leaf" packages, it's more a matter of making sure that either python2 or python3 are used than anythin else. A call to "#!/usr/bin/python" should only bre allowed for fully and proven version agnostic programs. Another positive effect of using direct calls is a much clearer output of tools like "ps" "pstree" "top" and consorts. Try starting 15 different python programs, all with "env python" and look at the output of those tools to see the humbug that the use of "env" causes. But that's me and my 2ct. - Yamaban. -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org