Skip to content

Fix windows launch file calling python node - #1010

Open
gftabor wants to merge 2 commits into
ros2:jazzyfrom
gftabor:patch-1
Open

gftabor wants to merge 2 commits into
ros2:jazzyfrom
gftabor:patch-1

Conversation

@gftabor

@gftabor gftabor commented Sep 20, 2026

Copy link
Copy Markdown

Description

Ros2 run does a check on windows for python files. They need to be executed through the python interpreter rather than directly from the system execute process call. (If the python files were "installed" through cmake)

Here we copy the logic over to launch. This solves

OSError: [WinError 193] %1 is not a valid Win32 application

Is this user-facing behavior change?

Windows won't crash anymore.

Did you use Generative AI?

The edit was suggested by chatGPT looking at the error traceback and the ros2 run source code.

Additional Information

Even getting to this point requires setting an environment variable
set PATHEXT=%PATHEXT%;.PY

Because there is a check for "is executable" that looks at a hard coded list of file extensions that windows knows how to execute.

Signed-off-by: Griffin Tabor <tabor473@gmail.com>
Signed-off-by: Griffin Tabor <tabor473@gmail.com>
@gftabor gftabor changed the title Update execute_local.py Fix windows launch file calling python node Sep 20, 2026
@gftabor

gftabor commented Sep 20, 2026

Copy link
Copy Markdown
Author

The PR ros2/launch_ros#577 replaces the need for the environment variable.

Launch_ros PR lets the python file get past the initial check.
Launch PR lets the python file actually run

@gftabor

gftabor commented Sep 20, 2026

Copy link
Copy Markdown
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant