[PATCH 3/4] Re: Catch KeyboardInterrupts and raise them

Nicolas Sebrecht nicolas.s-dev at laposte.net
Thu Dec 23 21:04:46 GMT 2010


On Thu, Dec 23, 2010 at 08:43:08PM +0100, Johannes Stezenbach wrote:
> On Wed, Dec 22, 2010 at 11:45:44PM +0100, Nicolas Sebrecht wrote:
> > On Wed, Dec 22, 2010 at 03:27:19PM +0100, Sebastian Spaeth wrote:
> > > 
> > >                  except:
> > > +                    #TODO, we should catch a specific Exception here, not ALL. But which?
> > >                      pass
> > 
> > What do you have in mind? Why do we only catch one specific exception?
> 
> Instead of "catch all exceptions except KeyboardInterrupt",
> how about "catch only EnvironmentError"?
> http://docs.python.org/release/2.6.6/library/exceptions.html#exception-hierarchy
> 
> (Note that e.g. socket.error is a subclass of IOError).
> 
> Besides fixing the KeyboardInterrupt issue, it would also
> give us back the tracebacks on unexpected errors.

But the IOError would be masked. I think we should have full tracebacks
every where and only catch errors we are able to fix or workaround for
sure.

-- 
Nicolas Sebrecht




More information about the OfflineIMAP-project mailing list