Set loader for namespace packages in `PathFinder.find_spec`
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 77.2k
- Forks
- 36k
- PR merge metrics
- PR metrics pending
Description
Bug report
While fixing #84530, I ran into the issue of the loader sometimes not being set for namespace packages. After talking with @ericvsmith, it seems that might have just been overlooked.
Responsible code:
https://github.com/python/cpython/blob/ebb8b512e959ca1a0a506ac0f0faf461b1b2ff85/Lib/importlib/_bootstrap_external.py#L1511
Your environment
- CPython versions tested on: main
- Operating system and architecture:
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
Read Lib/importlib/_bootstrap_external.py at the PathFinder.find_spec code linked in the issue, then review issue #84530 for the related context. Reproduce or inspect namespace-package discovery on CPython main and verify that the resulting spec consistently includes the expected loader.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100