Inconsistent exception types in code "ᵀrue=1"
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 77.2k
- Forks
- 35.9k
- PR merge metrics
- PR metrics pending
Description
Bug report
Bug description:
It got ValueError in other place when compile without traceback(I think it should be SyntaxError). In IDLE when you run this code it tips SyntaxError (but in compile and exec it can only be caught with ValueError).
Due to that it raised in compile, using SyntaxError to describe it is better.
CPython versions tested on:
CPython main branch
Operating systems tested on:
No response
Linked PRs
- gh-145690
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 reported ValueError with compile and exec for ᵀrue=1, then compare that behavior with IDLE's SyntaxError. The linked PR gh-145690 indicates that work is already underway; done would mean the invalid code consistently raises the intended exception in the affected paths.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100