Bug 573782 - python logging's fileConfig causes KeyError on shutdown
Summary: python logging's fileConfig causes KeyError on shutdown
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: python
Version: 5.4
Hardware: All
OS: Linux
high
low
Target Milestone: rc
: ---
Assignee: Dave Malcolm
QA Contact: Petr Šplíchal
URL:
Whiteboard:
Depends On:
Blocks: 743405 807971
TreeView+ depends on / blocked
 
Reported: 2010-03-15 19:02 UTC by Jeff Bastian
Modified: 2018-11-14 20:12 UTC (History)
7 users (show)

Fixed In Version: python-2.4.3-51.el5
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-01-08 07:22:25 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
demo program from upstream (821 bytes, application/x-gzip)
2010-03-15 19:02 UTC, Jeff Bastian
no flags Details
patch for logging/config.py (505 bytes, patch)
2010-03-15 19:10 UTC, Jeff Bastian
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2013:0045 0 normal SHIPPED_LIVE python bug fix and enhancement update 2013-01-07 15:28:13 UTC

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


Note You need to log in before you can comment on or make changes to this bug.