fix(plugins): record plugin-compat hit paths in POSIX form on every OS

`scan_plugin` stored `str(p.relative_to(plugin_dir))`, which is `sub\m.py` on
native Windows and `sub/m.py` elsewhere. The string is what compat notices print,
what `plugins_cmd` renders as `file:line`, and what the tests pin, so the same
plugin produced a different report per OS and
`test_scan_plugin_walks_dir_and_skips_tests` failed on Windows (#112576).
`.as_posix()` makes the recorded path stable and portable; nothing consumes the
native form.
This commit is contained in:
teknium1
2026-09-16 10:18:56 -07:00
committed by Teknium
parent b119575b04
commit 5eca9d717b

View File

@@ -189,7 +189,9 @@ def scan_plugin(plugin_dir: Optional[Path], manifest: Optional[Dict[str, Dict[st
src = p.read_text(encoding="utf-8", errors="replace")
except OSError:
continue
hits += scan_source(src, str(p.relative_to(plugin_dir)), manifest)
# POSIX form on every OS: notices/reports compare and dedupe on this string, and the
# compat tests pin ``sub/m.py`` — native Windows otherwise records ``sub\m.py`` (#112576).
hits += scan_source(src, p.relative_to(plugin_dir).as_posix(), manifest)
if cacheable:
with _scan_lock:
_scan_cache[key] = (signature, list(hits))