`pkgutil.get_data()` get confused by local modules for module installed with `pip install --editable`
Open
Nobody has claimed this yet.
type-bug
- Dominant language
- Python
- Stars
- 77.2k
- Forks
- 35.9k
- PR merge metrics
- PR metrics pending
Description
Bug report
Bug description:
First execute in bash:
git clone https://github.com/pyx-project/pyx
cd pyx
pip install -e .
cd pyx # important! Now the directory is inside two layers of /pyx
python
Then execute in Python:
import pkgutil
pkgutil.get_data("pyx", "data/pyxrc")
Return value is None.
Note that the return value would not be None if either -e or the second cd is omitted --- which shows that the data file is correctly available.
CPython versions tested on:
3.11
Operating systems tested on:
No response
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
Reproduce the bash and Python steps from the report, focusing on the pkgutil.get_data entry point after pip install -e . and the nested cd pyx. Trace why it returns None for data/pyxrc in that context, then verify that the same lookup returns the available data without requiring either workaround.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100