Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!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.004 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'warnings': 0.03; 'subject:Python': 0.05; 'python': 0.09; 'command-line': 0.09; 'fetch': 0.09; 'integers': 0.09; 'it;': 0.09; 'cases': 0.15; 'dec': 0.15; "(it's": 0.16; '24,': 0.16; 'from:addr:mrabarnett.plus.com': 0.16; 'from:addr:python': 0.16; 'from:name:mrab': 0.16; 'message-id:@mrabarnett.plus.com': 0.16; 'received:84.93': 0.16; 'received:84.93.230': 0.16; 'written.': 0.16; 'zero,': 0.16; 'wrote:': 0.17; 'odd': 0.17; '>>>': 0.18; '(or': 0.18; 'windows': 0.19; 'feb': 0.19; 'error.': 0.21; 'terminate': 0.22; 'universal': 0.22; 'apps': 0.23; 'errors': 0.23; 'header:In-Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; 'skip:" 20': 0.26; 'am,': 0.27; 'ibm': 0.27; 'chris': 0.28; '>>>>': 0.29; 'succeed': 0.29; 'error': 0.30; 'code': 0.31; 'received:84': 0.32; 'could': 0.32; 'raising': 0.33; 'to:addr :python-list': 0.33; 'that,': 0.34; "can't": 0.34; 'wrong': 0.34; 'pm,': 0.35; 'michael': 0.36; 'but': 0.36; 'characters': 0.36; 'too': 0.36; 'operating': 0.36; 'unable': 0.36; 'subject:: ': 0.38; 'positive': 0.38; 'some': 0.38; 'to:addr:python.org': 0.39; 'received:192': 0.39; 'skip:" 10': 0.40; 'received:192.168': 0.40; 'think': 0.40; 'success,': 0.62; 'success': 0.63; 'skip:n 10': 0.63; 'more': 0.63; 'header:Reply-To:1': 0.68; 'sounds': 0.71; 'reply-to:no real name:2**0': 0.72; '100': 0.78; '2013': 0.84; 'empire': 0.84; 'notion': 0.84; 'reply-to:addr:python.org': 0.84; 'dennis': 0.91 X-CM-Score: 0.00 X-CNFS-Analysis: v=2.0 cv=HO4d4PRv c=1 sm=1 a=0nF1XD0wxitMEM03M9B4ZQ==:17 a=_vX2mLoUpDQA:10 a=ihvODaAuJD4A:10 a=OUOv7kDek9cA:10 a=8nJEP1OIZ-IA:10 a=EBOSESyhAAAA:8 a=8AHkEIZyAAAA:8 a=I6uluiCgGVEA:10 a=pGLkceISAAAA:8 a=QrVWhbZvAAAA:8 a=P0zDdUhQ1wFpWUTbMmsA:9 a=wPNLvfGTeEIA:10 a=MSl-tDqOz04A:10 a=0nF1XD0wxitMEM03M9B4ZQ==:117 X-AUTH: mrabarnett:2500 Date: Sun, 24 Feb 2013 00:11:45 +0000 From: MRAB User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:17.0) Gecko/20130215 Thunderbird/17.0.3 MIME-Version: 1.0 To: python-list@python.org Subject: Re: Python Newbie References: <5127848B.1060004@gmail.com> <928d2cf7-728b-4f35-b8c9-4c9b958507e5@googlegroups.com> <8eadd52c-d533-4333-8c7f-7bf3a6d7b046@googlegroups.com> <9p1ii899tkalvfd1cl7sneoqa9t1cqh4oj@invalid.netcom.com> <5129482F.3080402@gmail.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: python-list@python.org 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: 31 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1361664709 news.xs4all.nl 6977 [2001:888:2000:d::a6]:38534 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:39724 On 2013-02-23 23:18, Chris Angelico wrote: > On Sun, Feb 24, 2013 at 9:52 AM, Michael Torrie wrote: >> On 02/23/2013 02:38 PM, Chris Angelico wrote: >>> On Sun, Feb 24, 2013 at 5:29 AM, Dennis Lee Bieber >>> wrote: >>>> Error codes under DEC VAX/VMS used odd integers for >>>> "success/information" and even integers for "warning/error" (been too >>>> many years, I think positive integers were success/warning, negative >>>> integers were information/error; I could also be wrong on which set were >>>> even... if 0 were no-info/success then odd were errors and even were >>>> success)). >>> >>> Sounds like IBM DB2 and sqlca.sqlcode - 0 for success, <0 for error, >>>> 0 for warning (or in some cases "status" - an SQLCODE of 100 means >>> "end of result set", which isn't exactly an error but you can't fetch >>> any more from it; it's akin to Python raising StopIteration to >>> terminate a for loop). >> >> All apps that return an error code to the operating system return 0 for >> success, any other value for error. All command-line utilities work >> this way, all shells, etc. Even Windows command-line apps work this way >> (errorlevel is what they call it). > > Yep, the 0 = success part is pretty much universal (it's been said > that the cause of the downfall of the Roman empire was that, lacking > zero, they were unable to succeed at anything), but the notion of > negative for errors and positive for warnings isn't as clear; > errorlevels and Unix return codes are positive-only. > ...although some C functions return a negative error code because a non-negative value is the number of characters written.