You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
importlib.metadata.entry_points(group=...) raises for every group on 3.15 when any distribution has a malformed entry point #163118
On Python 3.15, one installed distribution with a malformed entry-point value makes importlib.metadata.entry_points(group=...) raise ValueError for every group, including groups the malformed entry is not in. On 3.14 the same environment works.
EntryPoint.__init__ on the 3.15 branch evaluates self.module, so constructing the entry point validates its value. entry_points() constructs every entry point of every distribution before selecting by group, so the first invalid value anywhere aborts the selection.
Reproduction (3.15.2, a venv with only pydantic 2.14.4 installed, run with -I):
File ".../pydantic/plugin/_loader.py", line 40, in get_plugins
File ".../lib/python3.15/importlib/metadata/__init__.py", line 1125, in entry_points
...
File ".../lib/python3.15/importlib/metadata/__init__.py", line 243, in _match
raise ValueError(
ValueError: ('Invalid object reference. See https://packaging.python.org/en/latest/specifications/entry-points/#data-model', '!!')
pydantic asks only for the pydantic group; the malformed entry is in console_scripts. With the same badep dist-info on 3.14, the script runs. So does 3.15 with PYDANTIC_DISABLE_PLUGINS=1, which skips the entry_points call.
importlib_metadata restored lazy validation in python/importlib_metadata#523, "so one malformed entry point no longer prevents entry points in other groups from being selected" (its changelog). That change is on main through gh-160386 / GH-160387 (the 3.16 sync, 5a97efe766), whose EntryPoint.__init__ no longer touches self.module. The 3.15 branch still has the eager call. Since 3.15 is released and 3.14 did not fail this way, I'd ask for the lazy-validation part to be backported to 3.15 as a bug fix, separately from the rest of the 3.16 sync.
I’m interested in contributing a targeted backport of the lazy-validation behavior to the 3.15 branch, with regression tests covering the unrelated malformed entry-point case. Would the maintainers consider this an appropriate 3.15 bug-fix contribution, or is there a reason to leave the branch unchanged?
Activity
sreevx commentedon Dec 4, 2026
I’m interested in contributing a targeted backport of the lazy-validation behavior to the 3.15 branch, with regression tests covering the unrelated malformed entry-point case. Would the maintainers consider this an appropriate 3.15 bug-fix contribution, or is there a reason to leave the branch unchanged?