R: [Python-Dev] Deprecating string exceptions

Guido van Rossum guido@python.org
Thu, 28 Mar 2002 11:29:59 -0500


>     Guido> Sorry.  I told you I hadn't read the thread the first time around.
> 
> So, do we agree on this point?

Yes, "except:" should catch all exceptions, and in the future (when we
can enforce the rule) so should "except Exception:".

>     Guido> We should fix the "except:" examples by catching a very specific
>     Guido> error, like AttributeError, TypeError or KeyError.  *Not* by
>     Guido> catching Exception or StandardError.
> 
> Correct.  That's what the long-standing bug #411881 is about.  It
> just deals with the standard library however, and doesn't delve into
> the stuff in Tools, Demos, etc.

That's OK.  But I don't understand why that bug would provide an
argument for special-casing KeyboardInterrupt.

--Guido van Rossum (home page: http://www.python.org/~guido/)