-
Notifications
You must be signed in to change notification settings - Fork 13
Open
Description
See the attached sample Train script for a repro (macOS 15.5, using Python 3.11.4.)
Both these commands will never return and you need to press Ctrl+C to terminate the train script:
shell.system("python3 -c \"print('Hello World')\"", ".");
shell.system("python3 test.py --validate-only", ".");
Expected:
Both those print 'Hello world' and train moves on.
Observed:
You'll see the following printed to console, and nothing else. You'll need to press Ctrl+C to continue.
shell.system()(python3 -c "print('Hello World')" WD: /Users/work/...) { ...
and the same behaviour for the second one too.
Files
I can't attach train or Python files, so they are:
python-hanging.train:
// Bug Report: shell.system() hangs when executing Python scripts
//
// Expected: Python script should execute and return output
// Actual: shell.system() hangs indefinitely when calling Python scripts
//
// This affects any Python script execution, making it impossible to use
// Python-based systems with Train.
log("Testing simple Python command...");
try {
var result = shell.system("python3 -c \"print('Hello World')\"", ".");
log("Result: " + result);
} catch (e) {
log("Error: " + e);
}
log("Testing Python script file...");
try {
var result = shell.system("python3 test.py --validate-only", ".");
log("Result: " + result);
} catch (e) {
log("Error: " + e);
}
log("Test completed - if you see this, the bug was fixed");
and test.py:
#!/usr/bin/env python3
def main():
print("Hello, World!")
if __name__ == "__main__":
main()
Metadata
Metadata
Assignees
Labels
No labels