-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
space character problem in shebang path when poetry creates a CLI executable #8967
Comments
poetry install
and call my CLI without using poetry run
http://lists.gnu.org/archive/html/bug-bash/2008-05/msg00052.html says that this cannot be solved, but if you know better then please submit a merge request |
@dimbleby in fact, there is no way to escape spaces in the path of a shebang, but as suggested above it is possible to call the terminal shell instead of the python interpreter, and this makes it possible to have the same result. If there is someone who knows the poetry API, I would like that person to be able to do the PR in my place, but if no one is available I will be dedicating my free time to reading the code and trying to implement my suggested solution. Thanks for answering!! 😅 |
I will say that I do not find your suggestion very attractive. What do other installers (pip, pipx etc) do with paths with spaces? perhaps you are better off simply not exposing yourself to this: use paths without spaces. |
I tested it with pip, and it did practically the same thing as I suggested, see below: $ cat "/home/lelzin/Área de trabalho/xpto/.venv/bin/doky"
#!/bin/sh
'''exec' "/home/lelzin/Área de trabalho/xpto/.venv/bin/python" "$0" "$@"
' '''
# -*- coding: utf-8 -*-
import re
import sys
from doky.__main__ import main
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
sys.exit(main()) I thought Poetry was taken with seriousness and commitment, it's not the first time I've seen contributors to this project making light of basic problems like this. Asking me to simply avoid paths with spaces doesn't solve the problem, it just hides it under the rug. |
This bug is biting me too. I'm counting on using poetry to distribute my package to other developers, recreating the appropriate virtual environment for each on their own system, so I can't rely on (a) manually editing the shell script that poetry generates, or (b) never having directories with space characters in the project's absolute file path. Isn't portability between developers one of the main virtues of poetry? |
@ibeatty It's true, but from the conversation above it seems like they don't care about this specific case. But I'll keep the Issue open in case they change their mind.. |
duplicate #3643, this one can be closed |
Duplicate #3643 |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
OS version and name: Linux Archcraft - rolling release
pyproject.toml: any pyproject containing a defined script entrypoint on
tool.poetry.scripts
session.I am on the latest stable Poetry version, installed using a recommended method.
I have searched the issues of this repo and believe that this is not a duplicate.
I have consulted the FAQ and blog for any relevant entries or release notes.
If an exception occurs when executing a command, I executed it again in debug mode (
-vvv
option) and have included the output below.Issue
This issue is simillar to recent merged issue #7244, the same that I'm happily waiting for to arrive in the next release.
I have my project that works as CLI:
I run
poetry install
for poetry creates my CLI executable file, nice.Then, I run my CLI directly
doky auth
, but infortunely:And the saga of space characters strikes again 😁
My investigation:
And with this I concluded that the problem was the space in the shebang path, and this is my suggestion to solve this:
Please, I ask you to work on this, I LOVE POETRY, but I don't want to always have to solve it manually :(
The text was updated successfully, but these errors were encountered: