This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author gvanrossum
Recipients gvanrossum
Date 2012-10-05.14:46:25
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1349448386.51.0.852233729423.issue16141@psf.upfronthosting.co.za>
In-reply-to
Content
I just noticed that StreamHandler contains the following fragment in its emit() method:

  try:
    <do some writing>
  except (KeyboardInterrupt, SystemExit): #pragma: no cover                
    raise
  except:
    self.handleError(record)

Couldn't this be simplified to the following?

  try:
    <do some writing>
  except Exception:
    self.handleError(record)

I.e. instead of manually catching and re-raising a few BaseExceptions, just don't catch anything that derives from BaseException but not from Exception?

(I noticed because we have an internal clone of this class that occasionally gets augmented with yet another base exception that shouldn't be handled.
History
Date User Action Args
2012-10-05 14:46:26gvanrossumsetrecipients: + gvanrossum
2012-10-05 14:46:26gvanrossumsetmessageid: <1349448386.51.0.852233729423.issue16141@psf.upfronthosting.co.za>
2012-10-05 14:46:26gvanrossumlinkissue16141 messages
2012-10-05 14:46:25gvanrossumcreate