-
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
RunCommand incorrectly sets sys.argv for Poetry scripts #965
Comments
I think I've hit this issue with That is, When reload is broken, tornado tries to restart the app as |
Yes. I hit this with the Django hot reload server. |
@sdispater I've looked into this more and updated the issue with more information. I believe there is bug with |
Fixes python-poetryGH-965 Calling `sys.argv` should run the same program as the currently running program. To make calling Poetry scripts through RunCommand match this behavior, we must set `sys.argv[0]` to be the full path of the executable. This change makes the behavior of calling a script through `poetry run` the same as calling a script directly from the .venv/bin.
I've opened PR #1001 to fix this. |
Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward? This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
This is still an issue. I have a PR open (#1001) that will fix this. |
Fixes python-poetryGH-965 Calling `sys.argv` should run the same program as the currently running program. To make calling Poetry scripts through RunCommand match this behavior, we must set `sys.argv[0]` to be the full path of the executable. This change makes the behavior of calling a script through `poetry run` the same as calling a script directly from the .venv/bin.
Fixes python-poetryGH-965 Calling `sys.argv` should run the same program as the currently running program. To make calling Poetry scripts through RunCommand match this behavior, we must set `sys.argv[0]` to be the full path of the executable. This change makes the behavior of calling a script through `poetry run` the same as calling a script directly from the .venv/bin.
Fixes python-poetryGH-965 Calling `sys.argv` should run the same program as the currently running program. To make calling Poetry scripts through RunCommand match this behavior, we must set `sys.argv[0]` to be the full path of the executable. This change makes the behavior of calling a script through `poetry run` the same as calling a script directly from the .venv/bin.
Fixes python-poetryGH-965 Calling `sys.argv` should run the same program as the currently running program. To make calling Poetry scripts through RunCommand match this behavior, we must set `sys.argv[0]` to be the full path of the executable. This change makes the behavior of calling a script through `poetry run` the same as calling a script directly from the .venv/bin.
Fixes python-poetryGH-965 Calling `sys.argv` should run the same program as the currently running program. To make calling Poetry scripts through RunCommand match this behavior, we must set `sys.argv[0]` to be the full path of the executable. This change makes the behavior of calling a script through `poetry run` the same as calling a script directly from the .venv/bin.
Fixes python-poetryGH-965 Calling `sys.argv` should run the same program as the currently running program. To make calling Poetry scripts through RunCommand match this behavior, we must set `sys.argv[0]` to be the full path of the executable. This change makes the behavior of calling a script through `poetry run` the same as calling a script directly from the .venv/bin.
Fixes python-poetryGH-965 Calling `sys.argv` should run the same program as the currently running program. To make calling Poetry scripts through RunCommand match this behavior, we must set `sys.argv[0]` to be the full path of the executable. This change makes the behavior of calling a script through `poetry run` the same as calling a script directly from the .venv/bin.
Fixes python-poetryGH-965 Calling `sys.argv` should run the same program as the currently running program. To make calling Poetry scripts through RunCommand match this behavior, we must set `sys.argv[0]` to be the full path of the executable. This change makes the behavior of calling a script through `poetry run` the same as calling a script directly from the .venv/bin.
Fixes python-poetryGH-965 Calling `sys.argv` should run the same program as the currently running program. To make calling Poetry scripts through RunCommand match this behavior, we must set `sys.argv[0]` to be the full path of the executable. This change makes the behavior of calling a script through `poetry run` the same as calling a script directly from the .venv/bin.
Fixes python-poetryGH-965 Calling `sys.argv` should run the same program as the currently running program. To make calling Poetry scripts through RunCommand match this behavior, we must set `sys.argv[0]` to be the full path of the executable. This change makes the behavior of calling a script through `poetry run` the same as calling a script directly from the .venv/bin.
Fixes python-poetryGH-965 Calling `sys.argv` should run the same program as the currently running program. To make calling Poetry scripts through RunCommand match this behavior, we must set `sys.argv[0]` to be the full path of the executable. This change makes the behavior of calling a script through `poetry run` the same as calling a script directly from the .venv/bin.
Fixes python-poetryGH-965 Calling `sys.argv` should run the same program as the currently running program. To make calling Poetry scripts through RunCommand match this behavior, we must set `sys.argv[0]` to be the full path of the executable. This change makes the behavior of calling a script through `poetry run` the same as calling a script directly from the .venv/bin.
Fixes python-poetryGH-965 Calling `sys.argv` should run the same program as the currently running program. To make calling Poetry scripts through RunCommand match this behavior, we must set `sys.argv[0]` to be the full path of the executable. This change makes the behavior of calling a script through `poetry run` the same as calling a script directly from the .venv/bin.
A kindly notice to the maintainers, the fix is available, and already applied review commments, at PR #6737 |
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. |
-vvv
option).Issue
sys.argv varies when running package through
poetry run
vspoetry shell
poetry run cli
,sys.argv == ['cli']
poetry shell && cli
,sys.argv == ['/full/path/to/package/.venv/bin/cli']
EDIT: I've looked into this a little bit more and it seems like this RunCommand code is the root of the issue. We are assigning incorrect values to
sys.argv
for the executable. I believe thatsys.argv
should be args that, if called, will run the same program as the running program.poetry shell
is going to always work correctly because it doesn't touch Poetry. The virtualenv is added to the path so we're calling directly to the executable in the virtualenv bin.For the fix, I think we want to lookup the full path to the Poetry script in virtualenv bin and use that executable path as the first arg in
sys.argv
. I think that should fix this issue and make the behavior of calling scripts throughpoetry run
equal topoetry shell
.The text was updated successfully, but these errors were encountered: