Skip to content

Fix cross-platform command execution in ChangeAnalyze and Repair modules#37

Merged
guanpingxiao merged 3 commits into
PCART-tools:mainfrom
chuanyu-MHSL:main
Mar 25, 2026
Merged

Fix cross-platform command execution in ChangeAnalyze and Repair modules#37
guanpingxiao merged 3 commits into
PCART-tools:mainfrom
chuanyu-MHSL:main

Conversation

@chuanyu-MHSL
Copy link
Copy Markdown
Contributor

Add platform detection for Windows in addValueForAPI (ChangeAnalyze.py) and validateByRun (repair.py) functions. The following modifications have been made in this submission:

  1. ChangeAnalyze.py - addValueForAPI function:

    • Add platform detection for Windows in the else branch (when runPath is empty)
    • Use Windows path separator "\" and "&&" for command chaining on Windows
    • Keep Linux style with "/" and ";" for Unix-like systems
  2. repair.py - validateByRun function:

    • Add platform detection for Windows in both runPath empty and non-empty cases
    • Dynamically set Python interpreter path: "python.exe" on Windows, "bin/python" on Linux
    • Remove hardcoded executable='/bin/bash' parameter for subprocess.run to ensure cross-platform compatibility

chuanyu-MHSL and others added 3 commits March 24, 2026 13:35
Add platform detection for Windows in addValueForAPI (ChangeAnalyze.py) and validateByRun (repair.py) functions.
The following modifications have been made in this submission:

1. ChangeAnalyze.py - addValueForAPI function:
   - Add platform detection for Windows in the else branch (when runPath is empty)
   - Use Windows path separator "\\" and "&&" for command chaining on Windows
   - Keep Linux style with "/" and ";" for Unix-like systems

2. repair.py - validateByRun function:
   - Add platform detection for Windows in both runPath empty and non-empty cases
   - Dynamically set Python interpreter path: "python.exe" on Windows, "bin/python" on Linux
   - Remove hardcoded executable='/bin/bash' parameter for subprocess.run to ensure cross-platform compatibility
@guanpingxiao guanpingxiao merged commit 7e00c68 into PCART-tools:main Mar 25, 2026
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.

2 participants