Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.mixmin.net!newsreader4.netcologne.de!news.netcologne.de!bcyclone03.am1.xlned.com!bcyclone03.am1.xlned.com!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'python)': 0.05; 'bits': 0.07; 'exit': 0.07; 'puts': 0.07; 'variable,': 0.07; 'byte,': 0.09; 'bytes,': 0.09; 'exit.': 0.09; 'received:internal': 0.09; 'subject:error': 0.11; '(but': 0.15; 'message- id:@webmail.messagingengine.com': 0.16; 'received:10.202': 0.16; 'received:10.202.2': 0.16; 'received:66.111': 0.16; 'received:66.111.4': 0.16; 'received:messagingengine.com': 0.16; 'wrote:': 0.16; 'byte': 0.18; '(or': 0.21; 'bit': 0.23; 'normally': 0.23; 'header:In-Reply-To:1': 0.24; 'fri,': 0.31; 'code': 0.31; 'core': 0.32; 'languages': 0.34; 'to:addr:python- list': 0.35; 'success.': 0.36; 'two': 0.37; 'received:10': 0.37; 'subject:: ': 0.37; '12,': 0.37; 'received:66': 0.38; 'means': 0.39; 'to:addr:python.org': 0.39; 'from:no real name:2**0': 0.61; 'caused': 0.61; 'high': 0.62; 'header:Message-Id:1': 0.62; 'low': 0.83; '128,': 0.84 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.us; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=Tg2qNZe8c6yVyIa5N3El3jOKKgg=; b=bf27n0 FsZ3osoMNLRc/aVWJrz9CRoB+itWSEoEX13mRsR1yFHCfmAD4OyYKH5/NqrFjhLW FtIDArCGNwcH6Q7K2JdH0veNLVVqBzC81CugEM8pjiv0h9Lh9Pm32MZF6XC6uPHK rv4I6tDqV1/SzCZulcpfs53e81o862+xHyrYw= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=Tg2qNZe8c6yVyIa 5N3El3jOKKgg=; b=GHJ/5QLuAcHoZNAN/jG7I8Ozwd2KzmmrwFW0sW8QHnxozxu QeSPh6yuPHuGMBfawRaeowmpUAneoEosF+7QGCZ73A4jqwlu01AA+MpiZJlKaKuX YA10C0jlvciZgq4hsBYHEJZ0XXvoaGHD/I/0GwWy9jq8J+9YtISJxMXN7JG4= X-Sasl-Enc: JH/dAMbMK4yoqihLBty2XMI+cZq2vJ829oGI/ATu/2iq 1434119128 From: random832@fastmail.us To: python-list@python.org MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain X-Mailer: MessagingEngine.com Webmail Interface - ajax-ff004c4b In-Reply-To: References: <2ebdfdf225c075b2f5ef350b06bc14f0@myglnc.com> Subject: Re: os.system error returns Date: Fri, 12 Jun 2015 10:25:28 -0400 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 15 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1434119131 news.xs4all.nl 2874 [2001:888:2000:d::a6]:45774 X-Complaints-To: abuse@xs4all.nl X-Received-Bytes: 4227 X-Received-Body-CRC: 2547513989 Xref: csiph.com comp.lang.python:92527 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.