Bug 573782

Summary: python logging's fileConfig causes KeyError on shutdown
Product: Red Hat Enterprise Linux 5 Reporter: Jeff Bastian <jbastian>
Component: pythonAssignee: Dave Malcolm <dmalcolm>
Status: CLOSED ERRATA QA Contact: Petr Šplíchal <psplicha>
Severity: low Docs Contact:
Priority: high    
Version: 5.4CC: dmalcolm, katzj, lkocman, ohudlick, pasteur, psplicha, radek
Target Milestone: rcKeywords: Patch
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: python-2.4.3-51.el5 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-01-08 07:22:25 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 743405, 807971    
Attachments:
Description Flags
demo program from upstream
none
patch for logging/config.py none

Description Jeff Bastian 2010-03-15 19:02:45 UTC
Created attachment 400287 [details]
demo program from upstream

Description of problem:
If logging.config.fileConfig() is called after logging handlers already exist, a KeyError is thrown in the atexit call to logging.shutdown().
    Error in atexit._run_exitfuncs:
    Traceback (most recent call last):
      File "/usr/lib64/python2.4/atexit.py", line 24, in _run_exitfuncs
        func(*targs, **kargs)
      File "/usr/lib64/python2.4/logging/__init__.py", line 1333, in shutdown
        h.close()
      File "/usr/lib64/python2.4/logging/__init__.py", line 674, in close
        del _handlers[self]
    KeyError: <logging.StreamHandler instance at 0x2b5406327878>

Attached is a demo program and a patch from upstream Python bz 1534765 to fix the issue.

Version-Release number of selected component (if applicable):
python-2.4.3-27.el5

How reproducible:
every time

Steps to Reproduce:
1. python demo.py
  
Actual results:
KeyError: <logging.StreamHandler instance at 0x2b5406327878>

Expected results:
no errors

Additional info:
http://bugs.python.org/issue1534765

Comment 1 Jeff Bastian 2010-03-15 19:10:09 UTC
Created attachment 400289 [details]
patch for logging/config.py

Comment 4 Radek 2010-07-06 09:33:44 UTC
The same bug appears with consoleHandler in my case.

Comment 6 RHEL Program Management 2010-08-09 19:16:42 UTC
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated in the
current release, Red Hat is unfortunately unable to address this
request at this time. Red Hat invites you to ask your support
representative to propose this request, if appropriate and relevant,
in the next release of Red Hat Enterprise Linux.

Comment 8 Tru Huynh 2010-12-13 22:41:03 UTC
it didn't make it for 5.4 as stated, but it's not there either for 5.5. Could it be fixed for 5.6? reported also by a CentOS user. Thanks

Comment 9 Tru Huynh 2010-12-13 22:42:59 UTC
http://bugs.centos.org/view.php?id=4678 (I could not add it to the external tracker entry)

Comment 11 RHEL Program Management 2011-05-31 14:34:29 UTC
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated in the
current release, Red Hat is unfortunately unable to address this
request at this time. Red Hat invites you to ask your support
representative to propose this request, if appropriate and relevant,
in the next release of Red Hat Enterprise Linux.

Comment 14 RHEL Program Management 2012-04-02 10:48:39 UTC
This request was evaluated by Red Hat Product Management for inclusion
in a Red Hat Enterprise Linux release.  Product Management has
requested further review of this request by Red Hat Engineering, for
potential inclusion in a Red Hat Enterprise Linux release for currently
deployed products.  This request is not yet committed for inclusion in
a release.

Comment 21 errata-xmlrpc 2013-01-08 07:22:25 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2013-0045.html