-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using both :out and :err in run() reports the wrong exit code #6072
Comments
From @briandfoyHere's a program that starts another program with run() with #!/Applications/Rakudo/bin/perl6 use v6; my $filename = 'null-program.p6'; $fh.put( q:to/HERE/ ); exit 137; { { { #!/Applications/Rakudo/bin/perl6 use v6; my $filename = 'null-program.p6'; $fh.put( q:to/HERE/ ); exit 137; { { { { The fourth situation reports a different exit code: This goes to standard error { The fourth situation reports a different exit code: This goes to standard error |
Code snippet that is not mangled: use v6;
my $filename = 'sandbox/null-program.p6';
my $fh = open $filename, :w;
END { unlink $filename }
$fh.put: 「
$*ERR.say( Q/This goes to standard error/ );
$*OUT.say( Q/This goes to standard output/ );
exit 137;
」;
{
my $proc = run $*EXECUTABLE, $filename;
say "1. Exit is { $proc.exitcode }";
}
{
my $proc = run $*EXECUTABLE, $filename, :out;
$proc.out.slurp-rest( :close );
say "2. Exit is { $proc.exitcode }";
}
{
my $proc = run $*EXECUTABLE, $filename, :err;
$proc.err.slurp-rest( :close );
say "3. Exit is { $proc.exitcode }";
}
{
my $proc = run $*EXECUTABLE, $filename, :out, :err;
$proc.out.slurp-rest( :close );
$proc.err.slurp-rest( :close );
say "4. Exit is { $proc.exitcode }";
} Output on all releases: https://gist.github.com/AlexDaniel/fca7b261d6a4e46290d2fdb7645e5e2a Seems to be fixed after (2017-06-12) rakudo/rakudo@92bd7e4 just like #4456 |
Migrated from rt.perl.org#130781 (status was 'new')
Searchable as RT130781$
The text was updated successfully, but these errors were encountered: