Skip to content

shell.exec() does not capture output when it's supposed to #54

@davidm-ro

Description

@davidm-ro

See the attached sample Train script for a repro (macOS 15.5, using Python 3.11.4.)

shell-exec-empty-capture.train.zip

Using shell.exec() with capture true, I do not see any captured output. For example:

try {
    var result = shell.exec("/usr/bin/python3", "--version", {
        timeout: 10,
        capture: true,
        workdir: "."
    });
    log("Result: '" + result + "'");
    log("Length: " + result.length);
    log("Expected: Should contain Python version string");
} catch (e) {
    log("Error: " + e);
}

Expected

I see Result with the Python version (eg 3.11.4) and a non-zero length.

Observed

I get:

Result: ''
Length: 0

Please test with the attached script, it has two examples.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions