python-poetry / python-poetry/poetry
In windows poetry should return exit code Uint32 (permit over 255)
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 34.3k
- Forks
- 2.5k
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 30
Description
- I have searched the issues of this repo and believe that this is not a duplicate.
- I have searched the documentation and believe that my question is not covered.
Feature Request
In Windows, many installer or packaging deployment system (like Microsoft SCCM) relies on exit code which is over255.
Reference
- https://docs.microsoft.com/en-us/mem/configmgr/tenant-attach/app-install-error-reference
- https://docs.microsoft.com/ko-kr/uwp/api/windows.system.processlauncherresult.exitcode?view=winrt-19041
Different Behavior between python app.py and poetry run python app.py
- python returns exit code as it is to os.
- poetry run python returns exit code limit to max 255.
How to reproduce
I made helloExit.exe which returns exit code 6501 .
and getExitCode.py like below.
import subprocess
completedProc = subprocess.run('./helloExit.exe')
# Print the exit code.
print("Exit Code: " + str( completedProc.returncode))
exit (completedProc.returncode)
Test Result
$ python getExitCode.py
Do some work
Do some cleanup
Exit Code: 6501
$ echo %ERRORLEVEL%
6501
$ poetry run python getExitCode.py
Do some work
Do some cleanup
Exit Code: 6501
$ echo %ERRORLEVEL%
255
WorkAround
Obviously, poetry should return exit code compatible with os (windows).
But, for a while, if someone need get exit code over 255, I guess they could follow below steps.
- let poetry make every package dependency.
- make venv in project using
poetry config --local virtualenvs.in-project true - activate venv with shell command ( .venv\Scripts\activate.* )
- use python start_app.py
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the behavior with the provided helloExit.exe and getExitCode.py examples, comparing direct Python execution with poetry run. Trace the poetry run entry point that forwards subprocess exit codes and verify that the Windows result preserves 6501 rather than limiting it to 255.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100