← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1380806] [NEW] Shouldn't use unicode() when exception used in msgs

 

Public bug reported:

There are cases (identified by mriedem) where an exception is used as
replacement text and is coerced using unicode():

http://git.openstack.org/cgit/openstack/nova/tree/nova/compute/manager.py?id=2014.2.rc2#n3264

   reason=_("Driver Error: %s") % unicode(e))

http://git.openstack.org/cgit/openstack/nova/tree/nova/api/ec2/__init__.py?id=2014.2.rc2#n89

   LOG.exception(_("FaultWrapper: %s"), unicode(ex))

doing this can interfere with translation by causing things to be
prematurely translated.

Need to scan for and correct any occurrences.  Also need to look at
adding/updating a hacking check.

** Affects: nova
     Importance: Undecided
     Assignee: James Carey (jecarey)
         Status: New

** Changed in: nova
     Assignee: (unassigned) => James Carey (jecarey)

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1380806

Title:
  Shouldn't use unicode() when exception used in msgs

Status in OpenStack Compute (Nova):
  New

Bug description:
  There are cases (identified by mriedem) where an exception is used as
  replacement text and is coerced using unicode():

  http://git.openstack.org/cgit/openstack/nova/tree/nova/compute/manager.py?id=2014.2.rc2#n3264

     reason=_("Driver Error: %s") % unicode(e))

  http://git.openstack.org/cgit/openstack/nova/tree/nova/api/ec2/__init__.py?id=2014.2.rc2#n89

     LOG.exception(_("FaultWrapper: %s"), unicode(ex))

  doing this can interfere with translation by causing things to be
  prematurely translated.

  Need to scan for and correct any occurrences.  Also need to look at
  adding/updating a hacking check.

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1380806/+subscriptions


Follow ups

References