Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!204.52.135.9.MISMATCH!newsfeed.hal-mli.net!feeder1.hal-mli.net!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!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.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'exception': 0.05; 'responding': 0.07; 'utf-8': 0.07; 'mess': 0.09; 'statements': 0.09; 'thrown': 0.09; 'assume': 0.12; 'cases': 0.15; 'ascii,': 0.16; 'blanket': 0.16; 'catch-all': 0.16; 'file).': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'merely': 0.16; 'received:209.85.161.174': 0.16; 'subject:exception': 0.16; 'there..': 0.16; '\xa0(i': 0.16; 'wed,': 0.16; 'wrote:': 0.17; 'fix': 0.18; 'appears': 0.20; 'subject:problem': 0.22; '\xa0so': 0.22; 'trying': 0.22; 'posted': 0.23; '(you': 0.23; 'header:In-Reply-To:1': 0.23; 'error.': 0.24; "i've": 0.24; 'message-id:@mail.gmail.com': 0.27; 'error': 0.28; 'skip:" 20': 0.28; 'catching': 0.29; 'trace': 0.29; 'probably': 0.30; 'fixed': 0.30; 'am,': 0.30; 'received:209.85.161': 0.32; 'running': 0.34; 'file': 0.34; 'received:google.com': 0.34; 'getting': 0.35; "i'll": 0.35; 'received:209.85': 0.35; 'to:addr :python-list': 0.35; 'except': 0.35; 'goes': 0.35; 'really': 0.36; 'character': 0.36; 'but': 0.36; 'subject:: ': 0.37; 'being': 0.37; 'received:209': 0.37; 'self': 0.38; 'to:addr:python.org': 0.39; 'header:Received:5': 0.39; 'files': 0.40; 'where': 0.40; 'whole': 0.60; 'hope': 0.62; 'it!': 0.64; 'reads': 0.66; 'special': 0.74 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=1nwb7UIH6NSAtyCflwf/XmvFI3blw2I69HTQvY5Hmo4=; b=ajNYKN6dgpny38v9MKjlWeQFCsnPP5kYoFRDcHMkaYVX6E7QuxfW6lhw3HKyELkBwL X7PHXECZ2bcIbYO1+tLJTRQiONFskvKF6Y5bYYD0CSKIbWP7ROpP1mpx+76Mlc+GBHzo oz6k70hFY3H4gpQ6zKNHSAjWSNSkfPZ3lHOJy9/zVdB/+KzdA7QxJ1N8uko24osBzSvo QvILXHkeao5cwlY0IP3hy98MQW9f7oT4XZiBlAbhQkApc44k305M1lS5TgoSZSemeAKP yWgHq3XxfpmKy3ZXZg39DvKec5eLs2XpOZKpzr4E/xZYhJzJdthV+XW6HxH/pxkz4jKx q+3w== MIME-Version: 1.0 In-Reply-To: <4FEA0CC5.9050203@earthlink.net> References: <4FE79433.8020704@earthlink.net> <4FE7982C.5020708@mrabarnett.plus.com> <4FE79FC9.5050404@earthlink.net> <4FE7F6CC.2050704@earthlink.net> <4FE803F8.3050207@gmail.com> <4FE8803C.3020108@earthlink.net> <4FEA0CC5.9050203@earthlink.net> Date: Wed, 27 Jun 2012 07:36:09 +1000 Subject: Re: exception problem From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 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: 32 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1340746572 news.xs4all.nl 6931 [2001:888:2000:d::a6]:49677 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:24485 (You posted privately to me again; I hope you don't mind my responding on-list as this appears to have been merely oversight.) On Wed, Jun 27, 2012 at 5:25 AM, Charles Hixson wrote: > Only thing is, this whole mess started when I was trying to trace down an= d > expected error. =A0(Which turned out to be "self.chunkLine(..." where sel= f > wasn't defined.) =A0It was running without ANY error being displayed. =A0= Though > as I look an outer loop is inclosed in a try:except:finally: =A0It still = has > an unlabelled except, because I don't remember what exception is thrown w= hen > a file reads an unintelligible character =A0(i.e., it isn't really a utf-= 8 > file). =A0Currently I've fixed all the files so that they're either utf-8= or > just ASCII, so currently it isn't getting triggered, but it's still there= . > =A0So that's probably the explanation. =A0I think I'll fix that now. =A0(= I can, I > guess, assume that any exception will be caught by except BasicException:= ) That's the problem, your blanket try/except. Don't do it! It blinds you. Same goes for catching Exception or BaseException. Catch what you really need to catch, and reserve catch-all statements for special cases where you don't have access to the console. ChrisA