safishamsi and Claude Opus 4.8
289aa41284
fix(python): stop a stdlib-named loose module from capturing a bare import ( #4261 )
...
A non-package directory with a file named like a stdlib module (e.g.
`scripts/logging.py`) wrongly captured a bare `import logging` from a
sibling, binding the import — and member calls like `logging.getLogger()` —
to the local file instead of the stdlib module.
The false binding arose at three independent layers, all now guarded by a
vendored, deterministic `_PYTHON_STDLIB_MODULE_NAMES` frozenset (union of
3.10 and 3.13 `sys.stdlib_module_names`, NOT the host's live set):
- `_resolve_python_module_path`: an absolute import whose top-level name is
a stdlib module no longer resolves to a loose same-named `.py` file or
namespace dir. A deliberate package shadow (`logging/__init__.py`) still
resolves — only loose modules/namespaces are refused.
- `_repoint_python_sibling_imports`: stdlib-named loose siblings are no
longer indexed as repoint targets.
- build.py #1504 pre-migration stem-alias index: a stdlib-named Python file
no longer claims the collapsed bare-stem alias ("logging"), which would
otherwise re-capture the external edge. The directory-scoped alias
("scripts_logging") is still registered, so genuine stale-id references to
the file keep healing.
Adds a stdlib-shadow regression plus a non-stdlib positive control.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com >
2026-10-10 01:24:41 +01:00
..
2026-09-21 19:19:26 +01:00
2026-10-08 14:27:06 +01:00
2026-10-05 19:40:12 +01:00
2026-10-09 19:18:06 +01:00
2026-09-29 13:49:39 +01:00
2026-10-05 20:11:30 +01:00
2026-10-02 17:10:08 +01:00
2026-09-21 19:44:17 +01:00
2026-10-07 17:26:00 +01:00
2026-10-04 20:40:34 +01:00
2026-09-22 15:00:07 +01:00
2026-09-22 14:58:22 +01:00
2026-10-09 19:18:06 +01:00
2026-10-09 02:48:22 +01:00
2026-10-08 14:27:06 +01:00
2026-09-30 20:41:10 +01:00
2026-09-25 15:44:08 +01:00
2026-10-02 17:10:07 +01:00
2026-10-06 20:54:55 +01:00
2026-10-02 17:10:07 +01:00
2026-09-27 18:56:31 +01:00
2026-10-04 20:23:44 +01:00
2026-10-04 20:23:44 +01:00
2026-10-02 16:50:45 +01:00
2026-10-09 19:19:01 +01:00
2026-10-04 20:23:44 +01:00
2026-10-06 20:54:15 +01:00
2026-10-09 19:19:15 +01:00
2026-10-09 19:17:53 +01:00
2026-10-04 02:07:00 +01:00
2026-09-27 18:39:52 +01:00
2026-10-09 19:48:13 +01:00
2026-10-04 02:07:23 +01:00
2026-10-04 02:09:34 +01:00
2026-09-25 16:01:47 +01:00
2026-10-04 20:23:14 +01:00
2026-10-07 17:26:11 +01:00
2026-09-28 10:15:38 +01:00
2026-10-08 14:28:54 +01:00
2026-10-08 14:28:27 +01:00
2026-10-04 20:23:14 +01:00
2026-10-07 17:26:00 +01:00
2026-10-09 02:51:03 +01:00
2026-10-05 19:40:13 +01:00
2026-09-23 16:54:04 +01:00
2026-10-06 20:54:15 +01:00
2026-10-07 17:26:17 +01:00
2026-10-07 17:52:47 +01:00
2026-09-23 19:45:40 +01:00
2026-10-09 19:19:15 +01:00
2026-09-30 20:10:34 +01:00
2026-09-22 14:58:12 +01:00
2026-09-22 14:58:12 +01:00
2026-10-09 19:46:57 +01:00
2026-10-08 14:27:06 +01:00
2026-09-30 20:41:10 +01:00
2026-10-04 02:08:29 +01:00
2026-10-04 02:07:00 +01:00
2026-10-09 19:18:06 +01:00
2026-10-04 02:08:29 +01:00
2026-10-09 19:18:06 +01:00
2026-10-06 20:54:35 +01:00
2026-09-25 16:15:15 +01:00
2026-10-04 20:23:44 +01:00
2026-09-28 09:13:29 +01:00
2026-10-09 19:18:06 +01:00
2026-10-09 19:18:06 +01:00
2026-10-10 01:13:46 +01:00
2026-10-07 17:26:00 +01:00
2026-09-30 20:10:34 +01:00
2026-10-09 19:17:53 +01:00
2026-10-04 20:23:14 +01:00
2026-09-27 18:39:52 +01:00
2026-10-05 19:40:12 +01:00
2026-09-30 20:41:10 +01:00
2026-09-22 17:30:28 +01:00
2026-10-10 01:01:10 +01:00
2026-10-04 01:43:04 +01:00
2026-10-10 01:24:41 +01:00
2026-10-02 16:50:45 +01:00
2026-09-30 20:41:10 +01:00
2026-10-07 17:26:00 +01:00
2026-10-09 19:18:06 +01:00
2026-10-05 20:12:06 +01:00
2026-10-05 19:40:03 +01:00
2026-10-07 17:26:17 +01:00
2026-10-07 17:26:17 +01:00
2026-10-09 19:18:06 +01:00
2026-10-05 19:40:03 +01:00
2026-09-26 13:45:58 +01:00
2026-10-07 17:26:00 +01:00
2026-10-10 01:13:46 +01:00
2026-10-07 17:26:00 +01:00
2026-10-05 19:40:04 +01:00
2026-10-10 01:01:10 +01:00
2026-09-28 10:18:13 +01:00
2026-10-05 19:40:12 +01:00
2026-10-08 14:27:06 +01:00
2026-09-25 15:44:21 +01:00
2026-10-08 14:28:20 +01:00
2026-10-06 20:54:15 +01:00
2026-10-08 14:29:00 +01:00
2026-10-08 14:29:19 +01:00
2026-10-08 14:28:54 +01:00
2026-10-10 01:01:10 +01:00
2026-10-09 19:17:53 +01:00
2026-10-08 14:27:06 +01:00
2026-10-02 17:10:07 +01:00
2026-10-05 20:11:30 +01:00
2026-10-02 17:10:07 +01:00
2026-10-09 02:48:23 +01:00
2026-10-04 01:43:04 +01:00
2026-10-02 17:10:07 +01:00
2026-10-05 19:40:11 +01:00
2026-10-04 02:07:00 +01:00
2026-10-04 02:07:00 +01:00
2026-10-07 17:26:00 +01:00
2026-10-04 01:44:11 +01:00
2026-10-09 19:18:06 +01:00
2026-10-09 19:17:53 +01:00
2026-10-05 20:12:34 +01:00
2026-10-09 19:18:06 +01:00
2026-10-07 17:26:00 +01:00
2026-10-07 17:26:00 +01:00
2026-10-02 17:10:07 +01:00
2026-09-23 17:01:39 +01:00
2026-10-04 01:43:04 +01:00
2026-10-08 14:27:06 +01:00
2026-10-04 20:40:34 +01:00
2026-10-04 20:23:44 +01:00
2026-10-04 20:23:44 +01:00
2026-10-09 19:18:06 +01:00
2026-09-27 18:39:51 +01:00
2026-10-02 17:10:07 +01:00
2026-10-08 14:27:33 +01:00
2026-10-07 17:26:11 +01:00
2026-10-09 19:18:06 +01:00
2026-09-30 20:41:10 +01:00
2026-10-07 17:26:00 +01:00
2026-10-06 20:54:15 +01:00
2026-10-09 19:18:06 +01:00
2026-09-28 10:15:38 +01:00