Solution
This issue does not reproduce on Windows. To work around this behaviour on macOS, use one of the following methods:
Method 1: Sequence the Python Session Initialization (Recommended)
Ensure that the Python session is initialized and opened before invoking the System Exec VI:
- Add a Flat Sequence Structure frame prior to the parallel section of your code.
- Call Open Python Session inside this frame and pass the resulting Python session refnum to subsequent operations.
- In the following frame, run your Python operations and System Exec calls concurrently.
- Call Close Python Session only after all operations finish or during application shutdown.
Pre-opening the Python session ensures the helper process is already spawned before the System Exec stdout/stderr pipes are created, avoiding descriptor inheritance.
Method 2: Configure System Exec for Asynchronous Execution
If the Python session must be opened concurrently with the execution of the command:
- Wire a FALSE boolean constant to the wait until completion? input of the System Exec VI.
- If standard output or standard error data is required, redirect output to a file within the command line string (for example,
/bin/mycommand > /path/to/logfile 2>&1), as the standard output and standard error output terminals of the System Exec VI will be empty when executing asynchronously.