Pipe error codes off by a factor of 256

Mitch Chapman chapman at bioreason.com
Thu Dec 16 14:13:03 EST 1999


I assume you're talking about the value you get when you
close the pipe.  The semantics for that value are the same as for the
wait(2) system call.  The exit code for a process which exits
of its own free will is stored in the top 8 bits of the 16-bit
return code.

In other words, see the man page for wait(2).

Ben Glazer wrote:
> 
> I'm trying to capture the error code from a pipe opened with os.popen().
> 
> I can successfully store the returned code in a variable, but the
> returned code always is exactly 256 times larger than it should be.

--
Mitch Chapman
chapman at bioreason.com



More information about the Python-list mailing list