← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1449897] [NEW] neutron.agent.linux.utils.execute() fails to handle decoding in system locale (eg: Japanese)

 

Public bug reported:

The issue is that execute() method formats stderr and stdout in an str-
type string into a unicode-type string (since it is doing _() which
would be unicode).When we do string formatting on that, it is doing an
implicit conversion from str-type to unicode-type strings using the
system locale. This is going to cause an error with Japanese and other
languages with non-ascii characters (stdout/stderr characters that are
not in that locale specific character set)

eg:
response = utils.execute(full_args, check_exit_code=False)\n File "/usr/lib/python2.7/site-packages/neutron/agent/linux/utils.py", line 120, in execute\n stderr=_stderr)\nUnicodeDecodeError: \'ascii\' codec can\'t decode byte 0xe6 in position 141: ordinal not in range(128)\n'

** Affects: neutron
     Importance: Undecided
     Assignee: Esha Seth (eshaseth)
         Status: New

** Changed in: neutron
     Assignee: (unassigned) => Esha Seth (eshaseth)

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/1449897

Title:
  neutron.agent.linux.utils.execute() fails to handle decoding in system
  locale (eg: Japanese)

Status in OpenStack Neutron (virtual network service):
  New

Bug description:
  The issue is that execute() method formats stderr and stdout in an
  str-type string into a unicode-type string (since it is doing _()
  which would be unicode).When we do string formatting on that, it is
  doing an implicit conversion from str-type to unicode-type strings
  using the system locale. This is going to cause an error with Japanese
  and other languages with non-ascii characters (stdout/stderr
  characters that are not in that locale specific character set)

  eg:
  response = utils.execute(full_args, check_exit_code=False)\n File "/usr/lib/python2.7/site-packages/neutron/agent/linux/utils.py", line 120, in execute\n stderr=_stderr)\nUnicodeDecodeError: \'ascii\' codec can\'t decode byte 0xe6 in position 141: ordinal not in range(128)\n'

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


Follow ups

References