You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Python script execution does not relay exit code #5773
I don't have a suitable windows environment to test on but I can tweak the code to force it through the Popen branch anyway, at which point I see two things:
but that bug isn't in 1.2.0b1 so you won't see it, and after tweaking it manually I still get the expected return code when going through that branch on Linux
So I dunno, some sort of windows-only thing maybe?
@dimbleby thanks for your analysis! I’m not sure I understand the issue with #3339 since https://stackoverflow.com/a/1253161 suggests that passing a command as a list and setting shell=True on Windows should already convert the sequence to a string, but if it’s causing problems then feel free to revert it. It took over 1.5 years for #3339 to be reviewed and merged, so I won’t be working on that particular issue anymore.
I've performed more testing on my side and I've found that the error appears depending on the install mode of poetry...
If I install the last version of poetry (1.2.0b1) using pip (python -m pip install poetry==1.2.0b1) the return code is incorrect (same test as in the example).
If I install the last version of poetry (1.2.0b1) using the recommended mode (curl -sSL https://install.pyt...) the return code is correct.
I've performed more testing on my side and I've found that the error appears depending on the install mode of poetry...
1. If I install the last version of poetry (1.2.0b1) using pip (`python -m pip install poetry==1.2.0b1`) the return code is incorrect (same test as in the example).
2. If I install the last version of poetry (1.2.0b1) using the recommended mode (`curl -sSL https://install.pyt...`) the return code is correct.
Please try again on b2 -- the issue likely is because when installing with pip you're pulling in a stable (instead of pre-release) poetry-core.
Activity
dimbleby commentedon Jun 5, 2022
Works fine on Linux
relevant code seems to be https://github.com/python-poetry/poetry/blob/865aa94dd3393076f790d3351f6ae18483673e38/src/poetry/utils/env.py#L1501-#L1511.
I don't have a suitable windows environment to test on but I can tweak the code to force it through the
Popenbranch anyway, at which point I see two things:this code seems to have been broken by Fix running console scripts of editable dependencies on Windows #3339, I think it has to go
cmd = list_to_shell_command(command)if it's going to setshell=True, and then runcmdpoetry run python -c "import sys; sys.exit(13)"...but that bug isn't in 1.2.0b1 so you won't see it, and after tweaking it manually I still get the expected return code when going through that branch on Linux
So I dunno, some sort of windows-only thing maybe?
kevincon commentedon Jun 5, 2022
@dimbleby thanks for your analysis! I’m not sure I understand the issue with #3339 since https://stackoverflow.com/a/1253161 suggests that passing a command as a list and setting shell=True on Windows should already convert the sequence to a string, but if it’s causing problems then feel free to revert it. It took over 1.5 years for #3339 to be reviewed and merged, so I won’t be working on that particular issue anymore.
dimbleby commentedon Jun 5, 2022
I don't have a windows environment to test in: perhaps this is fine on Windows.
I guess if it's broken then someone who does use windows will notice soon enough...
radoering commentedon Jun 6, 2022
I can't reproduce the issue in cmd on Windows with either 1.2.0b1 or master. 🤷
cwichel commentedon Jun 6, 2022
I've performed more testing on my side and I've found that the error appears depending on the install mode of poetry...
python -m pip install poetry==1.2.0b1) the return code is incorrect (same test as in the example).curl -sSL https://install.pyt...) the return code is correct.neersighted commentedon Jun 9, 2022
Please try again on
b2-- the issue likely is because when installing withpipyou're pulling in a stable (instead of pre-release)poetry-core.cwichel commentedon Jun 10, 2022
Tested doing the following:
Everything seems to be working OK now 😄
github-actions commentedon Mar 2, 2024
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.