-
-
Notifications
You must be signed in to change notification settings - Fork 1
Description
Validate root-derived module names before caching
The new resolve_module_name short-circuits to module_name_from_roots and caches the result without checking whether that dotted name is actually a syntactically valid module. When sys.path contains overlapping prefixes (e.g. /usr/lib/python3.11 before /usr/lib/python3.11/lib-dynload), the helper returns strings like lib-dynload._asyncio.cpython-311-x86_64-linux-gnu.so, which fail package selectors such as pkg:literal:_asyncio. Because the invalid name is cached, the lookup_module_name fallback is never invoked and those frames remain unmatchable. The resolver should validate the candidate with is_valid_module_name (or similar) and fall back to the sys.modules scan on failure before inserting it into the cache.
Useful? React with πΒ / π.
Originally posted by @chatgpt-codex-connector[bot] in #58 (comment)