Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

superenv python shim breaks when used as a shebang #26216

Closed
jacknagel opened this issue Jan 28, 2014 · 4 comments
Closed

superenv python shim breaks when used as a shebang #26216

jacknagel opened this issue Jan 28, 2014 · 4 comments

Comments

@jacknagel
Copy link
Contributor

The superenv python shim does not work when used in the following way:

$ cat test
#!/usr/local/Library/ENV/4.3/python
import os
$ ./test
./test: line 2: import: command not found

This is because the shim is itself a script with a shebang and nested shebangs do not work.

This breaks some builds, for example gobject-introspection, which generates a python script with such a shebang.

@jacknagel
Copy link
Contributor Author

I think the shim needs to go. I was working on a similar approach last year in #20118, but abandoned it after some discussion. Even if this bug wasn't a blocker, whitelisting executables seems like a Sisyphean task.

To fix the python stuff, we need to reinstate the original python-superenv fixes that went in shortly after superenv itself; 8f0c5f7 and 50417c1 are relevant.

@mistydemeo
Copy link
Member

I think you're right, the shim isn't working. I'm going to revert it. Sorry I'd forgotten about the previous thread.

@mistydemeo
Copy link
Member

Reverted in 6896f9d.

@MikeMcQuaid
Copy link
Member

@jacknagel @mistydemeo On it. Should be relatively easy.

ehershey pushed a commit to ehershey/homebrew that referenced this issue Apr 4, 2014
* Only set PYTHONPATH for Python 2.
* Set the Python binary for superenv.

References Homebrew#24842.
Closes Homebrew#26197.
Closes Homebrew#26216.
Closes Homebrew#26218.
Closes Homebrew#26228.
@Homebrew Homebrew locked and limited conversation to collaborators Feb 17, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants