From a2df36b8c5ec13d06f57c2cb71e17f8787b50abb Mon Sep 17 00:00:00 2001 From: Eliott Jacopin Date: Sat, 31 Oct 2026 01:20:38 +0900 Subject: [PATCH] fix(rust): start the Python fallback as python3 on Windows The binary hands an event to run_hook.py when it does not model it, and on any error or panic. On Windows it started `python`, while the hook rows and the README require a real `python3`: on a machine where `python` is missing or only the Microsoft Store stub, every hand-over failed. Every Python row of hooks.json, SessionStart's install among them, already starts `python3`, so a machine the plugin runs on has one. CI is unaffected: the Windows build row only runs cargo test and build, and install_smoke already puts a python3.exe on PATH. Co-Authored-By: Claude Opus 5.5 --- plugins/murmuration/rust/src/platform.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/plugins/murmuration/rust/src/platform.rs b/plugins/murmuration/rust/src/platform.rs index 64d69ed..9beec20 100644 --- a/plugins/murmuration/rust/src/platform.rs +++ b/plugins/murmuration/rust/src/platform.rs @@ -14,10 +14,12 @@ pub(crate) enum Os { pub(crate) const OS: Os = if cfg!(windows) { Os::Windows } else { Os::Unix }; /// The interpreter the Python fallback is spawned with. +/// +/// `python3` on Windows too: the Python rows of `hooks.json` (SessionStart's install among them) start `python3`, so a +/// machine the plugin runs on has one, while `python` may be missing or only the Microsoft Store stub. pub(crate) fn python_for(os: Os) -> &'static str { match os { - Os::Unix => "python3", - Os::Windows => "python", + Os::Unix | Os::Windows => "python3", } } @@ -101,7 +103,7 @@ mod tests { #[test] fn python_names() { assert_eq!(python_for(Os::Unix), "python3"); - assert_eq!(python_for(Os::Windows), "python"); + assert_eq!(python_for(Os::Windows), "python3"); } #[test]