Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #92527 > unrolled thread

Re: os.system error returns

Started byrandom832@fastmail.us
First post2015-06-12 10:25 -0400
Last post2015-06-12 10:25 -0400
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: os.system error returns random832@fastmail.us - 2015-06-12 10:25 -0400

#92527 — Re: os.system error returns

Fromrandom832@fastmail.us
Date2015-06-12 10:25 -0400
SubjectRe: os.system error returns
Message-ID<mailman.425.1434119131.13271.python-list@python.org>
On Fri, Jun 12, 2015, at 09:54, Ian Kelly wrote:

> Exit code 0 traditionally means success. The exit status is two bytes,
> with
> the low-order byte normally containing the exit code and the high-order
> byte containing the signal that caused the program to exit.

That's backwards. The signal (or 0 for a normal exit, or 0177 if the
process is stopped) is in the low seven bits of the low-order byte, the
core dump flag is in the high bit of the low-order byte and the exit
status or the stop signal is in the high-order byte.

I think you're confused because the _shell_ puts the exit status, or the
signal plus 128, in the $? variable, and many languages (but not python)
follow suit.

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web