Syntax errors in the Python source files give exit code 2 when they should give 1 as exit code
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 20.6k
- Forks
- 3.3k
- PR merge metrics
- PR metrics pending
Description
Syntax errors in the Python source files give 2 when they should give 1, as exit code. 1 means the files have a problem, while 2 should mean a usage error.
I haven't verified myself where this is a problem; at the moment I'm relying on second-hand info from @sterliakov
Originally posted by @wyattscarpenter in #19548
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
No source file, test, or entry point is named. Start by reproducing the reported exit-code difference with a Python source file containing a syntax error, then trace the CLI path that classifies the result. Done means syntax errors return exit code 1 while usage errors continue to return 2, with a regression test covering the behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 32/100