-
Notifications
You must be signed in to change notification settings - Fork 415
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
Injected shebang does not escape whitespace in interpreter path #1212
Comments
Related: conda/conda#186 |
Duplicate of #1198. The workaround is now documented. |
Right, I missed that, sorry.
Actually, it is the script created by the venv to run the application, copied into the local bin directory. I think we should patch the path given to the method exposing the script: pipx/src/pipx/commands/common.py Line 56 in 950c9b0
Although that would require that the pipx home directory is always symlinked. |
There is an issue in iterm2 where the resolution was to symlink to https://gitlab.com/gnachman/iterm2/-/issues/9362
The more you know 👍 |
Driven by pypa/pipx#1212, where the latest pipx tries to put stuff under `~/Library/Application Support`, and then lots of stuff breaks because of spaces in paths. 🤦♂️
I've had another look into this. While the new pipx installation location on mac surfaces this issue, it is not a pipx issue. It's the packages use of For reproducing this, I created a dir called For the entrypoint of a python application, pip performs some magic with the shebang of the executable: > test dir with spaces head -n7 "$(which visidata)"
#!/bin/sh
'''exec' "/home/robert/private/code/test dir with spaces/.ven/bin/python3.11" "$0" "$@"
' '''
# -*- coding: utf-8 -*-
import re
import sys
from visidata.main import vd_cli It does not do this on the scripts of the installed python application: > test dir with spaces head -n3 "$(which vd)"
#!/home/robert/private/code/test dir with spaces/.ven/bin/python3.11
import visidata.main The application mentioned in this issue does not define an entrypoint, so it cannot be invoked if the venv lives in a path with spaces in it. Same for ranger. This was using just regular pip install into a venv. I've also spun up a mac VM and used pipx to do the installation, which shows the same behavior: IMO this should be reraised on the packages where you face this issue or on pip. The only thing we can do on pipx side about this, is catching the error and providing a more helpful error message. |
Thanks for reproducing! Sounds good. Since the author recommends installing Also, the linked entry point section is somewhat outdated, since it describes |
Sweet. I'll split this into separate issues and close this one. |
Describe the bug
After I've installed a package, whitespace is not properly escaped in the shebang.
How to reproduce
This is due to the unescaped whitespace in the shebang:
(But it seems like escaping whitespace in the shebang is not actually supported.)
Expected behavior
It should work.
The text was updated successfully, but these errors were encountered: