`pymain_run_file_obj`: validate file type before reading
Open
Nobody has claimed this yet.
extension-modules
type-bug
- Dominant language
- Python
- Stars
- 77.2k
- Forks
- 35.9k
- PR merge metrics
- PR metrics pending
Description
pymain_run_file_obj attempts to skip the source first line before verifying that the file is not a directory.
https://github.com/python/cpython/blob/4eab90f4f33e1c072faf9d2e231d310bdc90ec97/Modules/main.c#L382-L401
Linked PRs
- gh-142709
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 in Modules/main.c at the cited pymain_run_file_obj code around lines 382-401 and inspect the order of the file-type check and source-line handling. Done means the file type is validated before the source is read or skipped; review linked PR gh-142709 before starting.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, python
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100