You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm installing using the waf build tool, and ran into this problem with incorrect shebang lines for installed scripts.
The following script makes a virtualenv, writes a trivial package with a script, and installs it into the virtualenv. The output shows that the shebang line has incorrectly picked up the python from which the script is run, rather than the virtualenv python:
from os.path import join as pjoin, abspath
from subprocess import check_output
# Make virtualenv
check_output(['virtualenv', 'venv'])
# Write a tiny package
with open('setup.py', 'wt') as fobj:
fobj.write(
"""from distutils.core import setup
setup(scripts = ['test_script'])
""")
with open('test_script', 'wt') as fobj:
fobj.write(
"""#!python
print("Something")
""")
# Install package into virtualenv
venv_bin = pjoin(abspath('venv'), 'bin')
venv_python = pjoin(venv_bin, 'python')
check_output([venv_python, 'setup.py', 'install'])
# Show result of shebang rewrite
with open(pjoin(venv_bin, 'test_script'), 'rt') as fobj:
print(fobj.read())
that is, the shebang line should come from the virtualenv not the python running the script.
Running the same script with Python2 gives the correct shebang line.
Running the script in Linux gives the correct line.
I've tested with 1.11.6 and current develop branch.
Possibly related to gh-532 in that it concerns shebang lines, OSX and Python 3.
The text was updated successfully, but these errors were encountered:
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Just add a comment if you want to keep it open. Thank you for your contributions.
Sorry for the verbose title.
I'm installing using the
waf
build tool, and ran into this problem with incorrect shebang lines for installed scripts.The following script makes a virtualenv, writes a trivial package with a script, and installs it into the virtualenv. The output shows that the shebang line has incorrectly picked up the python from which the script is run, rather than the virtualenv python:
Running with Python 3:
The result should be something like:
that is, the shebang line should come from the virtualenv not the python running the script.
Running the same script with Python2 gives the correct shebang line.
Running the script in Linux gives the correct line.
I've tested with 1.11.6 and current
develop
branch.Possibly related to gh-532 in that it concerns shebang lines, OSX and Python 3.
The text was updated successfully, but these errors were encountered: