-
Notifications
You must be signed in to change notification settings - Fork 185
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dh-virtualenv does not fix shebangs by the latest pip/distlib #225
Comments
Should be fixed before 30 Apr – the pypi.org final switch date which implies using a recent pip. |
Thanks for flagging this! Do you happen to have a pointer to relevant parts of distlib/pip where this happens? I'd like to dig a bit and understand more |
It took me a while to find out what was causing this in the first place. |
Thanks! By the way, have to say this is a pretty damn neat hack on pip-side! Took a moment to grasp for me, but basically the flow is:
Now when executing the script with the long shebang, it'll be executed by your regular interpreter. Quotes don't matter (this took while for me to figure out), as the two first single quotes are just empty string (you can try this by executing This leads it to executing the same script again with the virtualenv's python interpreter, except this time the exec statement is actually just a random string in triple quotes and thus skipped! Mind. Blown. |
Side note: This trick would be neat to replicate in dh-virtualenv if we detect too long shebangs! |
Note: this is mainly working tests & code. No build tests yet. Related to issue #225
I added an initial PR, which still needs some test builds, to fix these shebangs |
@nailor Your pull request works correctly and produces corrected shebangs in my setup. Thanks ! |
This is now fixed in the master, closing the ticket |
With the latest pip, on "posix" systems, with shebang paths longer than 127 characters, pip generates a multiline shebang. dh-virtualenv is not aware of such paths and they keep their build-time value.
New shebang style example:
The text was updated successfully, but these errors were encountered: