Before the change, ansicat, netcache and opnk assume that the
interpreter location is always /bin/python. While some distributions
do provide python at this location, even as a python3 interpreter,
some others such as Debian do not provide a plain python interpreter
anymore, at least not by default. There exist packages to provide the
version 2 or the version 3 of the interpreter at that location, but
the three possible configurations (v2, v3 or none) are left at the
discretion of the administrator, so in practice can't really be
predicted in advance.
This change applies the same shebang as offpunk.py and the cache
migration script. Use of /usr/bin/env has also the side effect of
easing use of python3 interpreters installed at weird locations.
Signed-off-by: Étienne Mollier <emollier@debian.org>
---
Whether the side effect is a nice one or a defect is open to discussion.
As a packager, my standard will be to ensure the use of the distribution's
interpreter, to avoid interferences of any third-party provided interpreter
that might have overriden the system's one. But on upstream side, being able
to change interpreter just by switching PATH may be more appropriate for
testing a whole range of python interpreters.
My take is that any script should use the default interpreter. If
another interpreter is needed, this should be done by running it
manually (eg : /usr/local/mypython3 offpunk.py).
So, for me, there’s absolutely no downside.
I will apply this patch tomorrow unless someone makes a compelling
argument against it.
Thanks Étienne !
ansicat.py | 2 +-
netcache.py | 2 +-
opnk.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/ansicat.py b/ansicat.py
index 7637fd0..e356681 100755
--- a/ansicat.py
+++ b/ansicat.py
@@ -1,4 +1,4 @@
-#!/bin/python
+#!/usr/bin/env python3
import os
import sys
import shutil
diff --git a/netcache.py b/netcache.py
index 603561d..19ce834 100755
--- a/netcache.py
+++ b/netcache.py
@@ -1,4 +1,4 @@
-#!/bin/python
+#!/usr/bin/env python3
import os
import sys
import urllib.parse
diff --git a/opnk.py b/opnk.py
index e256c19..33614c2 100755
--- a/opnk.py
+++ b/opnk.py
@@ -1,4 +1,4 @@
-#!/bin/python
+#!/usr/bin/env python3
#opnk stand for "Open like a PuNK".
#It will open any file or URL and display it nicely in less.
#If not possible, it will fallback to xdg-open
--
2.40.1