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


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

Re: exception problem

Started byDave Angel <d@davea.name>
First post2012-06-24 21:02 -0400
Last post2012-06-24 21:02 -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: exception problem Dave Angel <d@davea.name> - 2012-06-24 21:02 -0400

#24408 — Re: exception problem

FromDave Angel <d@davea.name>
Date2012-06-24 21:02 -0400
SubjectRe: exception problem
Message-ID<mailman.1468.1340586188.4697.python-list@python.org>
On 06/24/2012 07:16 PM, Charles Hixson wrote:
> On 06/24/2012 03:43 PM, MRAB wrote:
>> On 24/06/2012 23:26, Charles Hixson wrote:
>>> <SNIP>
>>>
>>>
>> Don't use a bare "except"; it'll catch _any__exception. Catch only what
>> you expect.
>>
>> For all I know, it could be that the name "l" doesn't exist.
> But what I wanted was to catch any exception.  A problem was happening
> and I had no clue as to what it was.  (It turned out to be "self is
> not defined".  A silly mistake, but a real one.)
>

If you don't get anything else out of this thread, get this point.  A
bare except is exactly the opposite of what you want to debug an
exception.  It swallows all the information that python would have
displayed for you.

Four or five of us have made the same point, so please listen.

-- 

DaveA

[toc] | [standalone]


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


csiph-web