Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!eu.feeder.erje.net!xlned.com!feeder1.xlned.com!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.011 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'exception': 0.03; 'that?': 0.05; 'filename': 0.07; 'abort': 0.09; 'propagate': 0.09; 'to:addr:comp.lang.python': 0.09; 'cc:addr:python-list': 0.10; 'anyway': 0.11; 'ignore': 0.13; '"real"': 0.16; 'exception?': 0.16; 'module': 0.19; 'bit': 0.21; 'cc:2**0': 0.23; 'cc:no real name:2**0': 0.24; 'idea': 0.24; 'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; 'disk': 0.27; 'errors.': 0.27; 'correct': 0.28; 'trouble': 0.28; 'probably': 0.29; 'maybe': 0.29; 'that.': 0.30; '(and': 0.32; 'received:google.com': 0.34; 'so,': 0.35; 'doing': 0.35; 'continue': 0.35; 'received:209.85': 0.35; 'there': 0.35; 'but': 0.36; "didn't": 0.36; 'subject:with': 0.36; 'should': 0.36; 'bad': 0.37; 'received:209': 0.37; 'far': 0.37; 'subject:: ': 0.38; 'save': 0.61; 'first': 0.61; 'between': 0.63; 'cut': 0.71; 'yourself': 0.77; 'console,': 0.84; 'distinguish': 0.84; 'them)': 0.84; 'thing,': 0.84 X-Received: by 10.49.120.105 with SMTP id lb9mr158420qeb.17.1362253174790; Sat, 02 Mar 2013 11:39:34 -0800 (PST) Newsgroups: comp.lang.python Date: Sat, 2 Mar 2013 11:39:34 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=207.102.131.95; posting-account=ABEwJgoAAAC1F6nSxfugvLwMw0aH_wrF References: <707df78f-9a67-4ce1-8dd3-095c75a7f7da@googlegroups.com> User-Agent: G2/1.0 X-Google-Web-Client: true X-Google-IP: 207.102.131.95 MIME-Version: 1.0 Subject: Re: Dealing with exceptions From: bvdp To: comp.lang.python@googlegroups.com Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Message-ID: Lines: 30 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1362253693 news.xs4all.nl 6908 [2001:888:2000:d::a6]:33330 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:40361 >=20 > Here's a bit of a left-field thought: Maybe none of them. >=20 Not far left at all :) >=20 > What are you actually doing when you get an exception? Can you >=20 > plausibly recover? If not - that is, if you're going to abort the >=20 > whole operation anyway - then save yourself the trouble of writing the >=20 > try/catch, and just let the exception propagate up (to the console, if >=20 > nowhere else). >=20 My first cut of the program did exactly that. Just abort the whole thing, f= iguring that the disk was full or buggered. What I ran into was that half way through the process I ended up with a fil= ename which the FAT32 didn't like. So, my brain-dead idea was to catch thos= e (and ignore them) and continue on. But then I have to distinguish between= a bad filename and "real" errors. But, you are probably correct if you say I should check the filename first = :) Is there a module for that?