Process.run fails if stdin is an empty string. Here is a toy program
that demonstrates it:
-- cut here --
void run(string input)
{
werror("Input: %O\n", input);
werror("Result: %O\n", Process.run( ({ "od", "-c" }),
([ "stdin": input ]) ));
}
int main()
{
run("foo");
run("");
return 0;
}
-- cut here --
The for invocation (which essentiall runs "echo foo | od -c") works
fine. The second crashes with an error message: "Failed to convert
argument to a source".
This used to work in Pike 7.8, but fails in Pike 8.0.388 (in the
version distributed with Debian 9 ("stretch")), and on the 8.0 and
master branches in the Pike git repo.
The complete output I'm seeing is:
Input: "foo"
Result: ([ /* 3 elements */
"exitcode": 0,
"stderr": "",
"stdout": "0000000 f o o\n"
"0000003\n"
])
Input: ""
Failed to convert argument to a source
/usr/lib/pike8.0/modules/Shuffler.so:1: Shuffler.Shuffle()->add_source("")
/usr/lib/pike8.0/modules/Process.pmod:617:
Process.run(({"od","-c"}),mapping[1])
run-stdin.pike:4: /main()->run("")
run-stdin.pike:11: /main()->main()