Merge lp:~ewanmellor/swift/lp820185 into lp:~hudson-openstack/swift/trunk

Proposed by Ewan Mellor
Status: Merged
Approved by: John Dickinson
Approved revision: 336
Merged at revision: 336
Proposed branch: lp:~ewanmellor/swift/lp820185
Merge into: lp:~hudson-openstack/swift/trunk
Diff against target: 16 lines (+6/-0)
1 file modified
test/__init__.py (+6/-0)
To merge this branch: bzr merge lp:~ewanmellor/swift/lp820185
Reviewer Review Type Date Requested Status
John Dickinson Approve
gholt (community) Approve
Review via email: mp+70253@code.launchpad.net

Commit message

Bug #820185: Intermittent TypeError NoneType in atexit handler of unit tests

Work around what appears to be a Python standard library bug by silencing
exceptions in the logging library.

Description of the change

Bug #820185: Intermittent TypeError NoneType in atexit handler of unit tests

Work around what appears to be a Python standard library bug by silencing
exceptions in the logging library.

To post a comment you must log in.
Revision history for this message
gholt (gholt) wrote :

I've seen this for quite some time in the builds as well, though not on my local machine as of yet. That particular stack trace doesn't seem to cause any failures outside of what it displays. Is this required to be fixed?

I'm worried the side-effect of not raising any exceptions with logging could cause us more and real problems (handlers not set correctly, bugs in formatters, etc.) As a quick example, this logging problem is completely silent and no one would realize a .critical() was even attempted.

    import logging

    logging.raiseExceptions = False
    logger = logging.getLogger()
    logger.addHandler(logging.StreamHandler())
    logger.critical('test %s %s', ('one',))

Revision history for this message
gholt (gholt) wrote :

Oh, nevermind. Didn't realize it was a test only thing, lol.

review: Approve
Revision history for this message
John Dickinson (notmyname) wrote :

lgtm

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'test/__init__.py'
--- test/__init__.py 2011-02-24 22:21:14 +0000
+++ test/__init__.py 2011-08-03 06:06:11 +0000
@@ -12,6 +12,12 @@
12setattr(__builtin__, '_', lambda x: x)12setattr(__builtin__, '_', lambda x: x)
1313
1414
15# Work around what seems to be a Python bug.
16# c.f. https://bugs.launchpad.net/swift/+bug/820185.
17import logging
18logging.raiseExceptions = False
19
20
15def get_config():21def get_config():
16 """22 """
17 Attempt to get a functional config dictionary.23 Attempt to get a functional config dictionary.