mesonbuild / mesonbuild/meson-python
Possible unhandled `StopIteration`
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 180
- Forks
- 93
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 18
Description
`StopIteration` can mask the split-package error in `mesonpy/__init__.py:160`. In the purelib/platlib conflict branch, `next(entry for entry in wheel_files[other] ...)` has no default. If the package was first registered by an `install_subdirs` entry whose directory walked to zero files, packages has the entry but `wheel_files[other]` has none, and the user gets a raw `StopIteration`/`RuntimeError` instead of the helpful `BuildError`. Use `next(..., None)` and degrade the message.
Originally reported in #861.
This is a correct observation. However, the condition for triggering it is between very unlikely and impossible. I haven't yet tried to determine whether it is really impossible.
Contributor guide
No contributing guide indexed for this repository
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 mesonpy/__init__.py around line 160 and inspect the purelib/platlib conflict branch, especially the lookup in wheel_files[other]. Change the missing-entry path so an empty install_subdirs result produces a degraded but helpful BuildError rather than raw StopIteration or RuntimeError. Done means the conflict is still reported clearly even when no wheel files are available.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 68/100