{"action":"created","issue":{"url":"https://api.github.com/repos/pypa/virtualenv/issues/845","labels_url":"https://api.github.com/repos/pypa/virtualenv/issues/845/labels{/name}","comments_url":"https://api.github.com/repos/pypa/virtualenv/issues/845/comments","events_url":"https://api.github.com/repos/pypa/virtualenv/issues/845/events","html_url":"https://github.com/pypa/virtualenv/issues/845","id":127770659,"number":845,"title":"Scripts installed with wrong shebang under subprocess","user":{"login":"jaraco","id":308610,"avatar_url":"https://avatars.githubusercontent.com/u/308610?v=3","gravatar_id":"","url":"https://api.github.com/users/jaraco","html_url":"https://github.com/jaraco","followers_url":"https://api.github.com/users/jaraco/followers","following_url":"https://api.github.com/users/jaraco/following{/other_user}","gists_url":"https://api.github.com/users/jaraco/gists{/gist_id}","starred_url":"https://api.github.com/users/jaraco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaraco/subscriptions","organizations_url":"https://api.github.com/users/jaraco/orgs","repos_url":"https://api.github.com/users/jaraco/repos","events_url":"https://api.github.com/users/jaraco/events{/privacy}","received_events_url":"https://api.github.com/users/jaraco/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":14,"created_at":"2016-01-20T19:56:51Z","updated_at":"2016-01-21T02:39:19Z","closed_at":null,"body":"On Python 3.5.1 but not on 2.7.10, when I invoke pip through a subprocess in a virtualenv, the scripts are created with the wrong shebang and thus fail to run:\r\n\r\n```\r\n$ cat > invoke.py\r\nimport sys\r\nimport subprocess\r\n\r\nsubprocess.Popen(sys.argv[1:]).wait()\r\n$ rm -Rf env\r\n$ python -m virtualenv --version\r\n14.0.0\r\n$ python --version\r\nPython 3.5.1\r\n$ python -m virtualenv env\r\nUsing base prefix '/Library/Frameworks/Python.framework/Versions/3.5'\r\nNew python executable in /Users/jaraco/Dropbox/code/public/aspen/env/bin/python3\r\nAlso creating executable in /Users/jaraco/Dropbox/code/public/aspen/env/bin/python\r\nInstalling setuptools, pip, wheel...done.\r\n$ python invoke.py env/bin/pip install pytest\r\nCollecting pytest\r\n  Using cached pytest-2.8.5-py2.py3-none-any.whl\r\nCollecting py>=1.4.29 (from pytest)\r\n  Using cached py-1.4.31-py2.py3-none-any.whl\r\nInstalling collected packages: py, pytest\r\nSuccessfully installed py-1.4.31 pytest-2.8.5\r\n$ head -n 1 env/bin/py.test\r\n#!/Library/Frameworks/Python.framework/Versions/3.5/bin/python3\r\n```\r\n\r\nOne would expect the py.test script to have a shebang with 'env' in it.\r\n\r\nUsing pyvenv instead is not subject to the issue. Removing the `__PYVENV_LAUNCHER__` environment variable before launching the subprocess works around the issue, as [reported here](https://github.com/gratipay/aspen.py/issues/542#issuecomment-173339397). The issue was observed with 13.1.2 and 14.0.0.\r\n\r\nIs this behavior expected? If so, is removing the environment variable the appropriate thing for a parent process to do to work around the issue?"},"comment":{"url":"https://api.github.com/repos/pypa/virtualenv/issues/comments/173433275","html_url":"https://github.com/pypa/virtualenv/issues/845#issuecomment-173433275","issue_url":"https://api.github.com/repos/pypa/virtualenv/issues/845","id":173433275,"user":{"login":"Ivoz","id":199266,"avatar_url":"https://avatars.githubusercontent.com/u/199266?v=3","gravatar_id":"","url":"https://api.github.com/users/Ivoz","html_url":"https://github.com/Ivoz","followers_url":"https://api.github.com/users/Ivoz/followers","following_url":"https://api.github.com/users/Ivoz/following{/other_user}","gists_url":"https://api.github.com/users/Ivoz/gists{/gist_id}","starred_url":"https://api.github.com/users/Ivoz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ivoz/subscriptions","organizations_url":"https://api.github.com/users/Ivoz/orgs","repos_url":"https://api.github.com/users/Ivoz/repos","events_url":"https://api.github.com/users/Ivoz/events{/privacy}","received_events_url":"https://api.github.com/users/Ivoz/received_events","type":"User","site_admin":false},"created_at":"2016-01-21T02:39:19Z","updated_at":"2016-01-21T02:39:19Z","body":"@vsajip could you give any advice?"}}