From 422e2e0c8a2f5b584973108ccd041255f3665916 Mon Sep 17 00:00:00 2001 From: Griffin Tabor Date: Sun, 20 Sep 2026 12:56:27 -0400 Subject: [PATCH 1/2] Update execute_local.py Signed-off-by: Griffin Tabor --- launch/launch/actions/execute_local.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/launch/launch/actions/execute_local.py b/launch/launch/actions/execute_local.py index 487ae905c..ce5f4e7d5 100644 --- a/launch/launch/actions/execute_local.py +++ b/launch/launch/actions/execute_local.py @@ -14,6 +14,7 @@ """Module for the ExecuteLocal action.""" +import sys import asyncio import io import logging @@ -566,6 +567,11 @@ async def __execute_process(self, context: LaunchContext) -> None: ) try: + # On Windows, Python scripts cannot be passed directly to CreateProcess(). + # Invoke them through the Python interpreter, matching ros2run behavior. + print('LAUNCH CMD:', cmd) + if os.name == 'nt' and cmd and cmd[0].lower().endswith('.py'): + cmd.insert(0, sys.executable) transport, self._subprocess_protocol = await async_execute_process( lambda **kwargs: self.__ProcessProtocol( self, context, process_event_args, **kwargs From 793db22b197c45448c6a95eb5597077d15309bcb Mon Sep 17 00:00:00 2001 From: Griffin Tabor Date: Sun, 20 Sep 2026 13:15:11 -0400 Subject: [PATCH 2/2] removed debug statement in Signed-off-by: Griffin Tabor --- launch/launch/actions/execute_local.py | 1 - 1 file changed, 1 deletion(-) diff --git a/launch/launch/actions/execute_local.py b/launch/launch/actions/execute_local.py index ce5f4e7d5..4a9fdb85f 100644 --- a/launch/launch/actions/execute_local.py +++ b/launch/launch/actions/execute_local.py @@ -569,7 +569,6 @@ async def __execute_process(self, context: LaunchContext) -> None: try: # On Windows, Python scripts cannot be passed directly to CreateProcess(). # Invoke them through the Python interpreter, matching ros2run behavior. - print('LAUNCH CMD:', cmd) if os.name == 'nt' and cmd and cmd[0].lower().endswith('.py'): cmd.insert(0, sys.executable) transport, self._subprocess_protocol = await async_execute_process(