mitogen icon indicating copy to clipboard operation
mitogen copied to clipboard

Modules and script hard code /usr/bin/python in hashbang

Open moreati opened this issue 4 years ago • 5 comments

A number of modules, and scripts in the test suite start with

#!/usr/bin/python

In general it is better to use

#!/usr/bin/env python

because that allows execution inside a virtualenv, or when python is installed elsewhere, e.g. /usr/loca/bin/python.

There may be cases in which we really do want to hard code the path, e.g.

  • testing detection/selection of ansible_python_interpreter (correct name?)
  • mechanics of Ansible module transfer, or recognition .

If so those should be explictly noted in a comment.

moreati avatar Feb 14 '21 14:02 moreati

I think there's a typo above, both cases are #!/usr/bin/env python which I think is just the "right" one?

sjpb avatar Jun 02 '21 09:06 sjpb

I think it a typo in the description with the correct title.

grep /usr/bin/python -r * | awk -F ':' '{print $1}' | uniq | wc -l
36

yurnov avatar Jun 09 '21 08:06 yurnov

Sorry for the confusion, I've amended the description.

moreati avatar Nov 19 '21 23:11 moreati

#849

MeatsMountain avatar Jul 21 '22 17:07 MeatsMountain

9FFA77DB-9ECA-4B4A-B893-875722A6334F #929

MeatsMountain avatar Jul 21 '22 17:07 MeatsMountain