[New-bugs-announce] [issue2424] Logging module hides user code errors (bare except)

Brad Allen report at bugs.python.org
Wed Mar 19 17:55:27 CET 2008


New submission from Brad Allen <brad at allendev.com>:

The logging module contains several bare except statements. It's
understandable that the logging module should be completely silent, but
in the case of logging.config, the bare except can make it very
difficult to identify when there is a problem with a customer handler or
even with configuration.

These are the offending lines (lines 133-134): 

except: #if an error occurs when instantiating a handler, too bad
    pass    #this could happen e.g. because of lack of privileges

Maybe this should only catch OSError, so that other problems will
generate a failure at this point and show the correct traceback. My
experience is that there is usually a failure anyway when there is a
configuration problem, but the error is usually misleading.

By the way, exceptions generated here seem to mainly occur when a Python
script is first starting up, as it involves the initial configuration. I
am not convinced that the logging module should be silent at that stage.

----------
components: Library (Lib)
messages: 64069
nosy: bradallen
severity: normal
status: open
title: Logging module hides user code errors (bare except)
type: behavior
versions: Python 2.4

__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue2424>
__________________________________


More information about the New-bugs-announce mailing list