eventlet backdoor doesn't always play nicely with gettext

Bug #1010236 reported by Johannes Erdfelt
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Undecided
Johannes Erdfelt

Bug Description

When using the eventlet backdoor for troubleshooting, it can sometimes interfere with the global _ symbol that gettext installs. It can often manifest itself as an exception similar to this:

TypeError: 'dict' object is not callable

With the type varying.

The problem is the default sys.displayhook function. It will take the return value of the last expression, print it and then set it to __builtin__._, which is also the variable that gettext sets to allow _() to be used to internationalize strings.

An attempt to workaround the problem was implemented, but it does not always work.

The fix is to implement a new sys.displayhook that plays nicer with gettext.

Changed in nova:
assignee: nobody → Johannes Erdfelt (johannes.erdfelt)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/8314

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/8314
Committed: http://github.com/openstack/nova/commit/dfa9e5210cc3569dc2d5d8fc3ea45e610c766ffc
Submitter: Jenkins
Branch: master

commit dfa9e5210cc3569dc2d5d8fc3ea45e610c766ffc
Author: Johannes Erdfelt <email address hidden>
Date: Thu Jun 7 22:59:41 2012 +0000

    Make eventlet backdoor play nicer with gettext

    Fixes bug 1010236

    Implement a new sys.displayhook that doesn't overwrite __builtin__._
    that was set by gettext

    Change-Id: Id3c0a331eb6f98240fe1e4d0b083c72e28f99c53

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → folsom-2
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: folsom-2 → 2012.2
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.