← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1503415] Re: We should not bypass bytes decode/encode

 

** Changed in: python-neutronclient
       Status: Fix Committed => Fix Released

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

Title:
  We should not bypass bytes decode/encode

Status in neutron:
  Fix Released
Status in python-neutronclient:
  Fix Released
Status in python-neutronclient liberty series:
  Fix Committed

Bug description:
  The commit fcf289797c063088f9003359dfd1c7d4f41ed5ef[1] introduces the
  pattern:

    if six.PY3:
      if isinstance(line, bytes):
        try:
          line = line.decode(encoding='utf-8')
        except UnicodeError:
          pass
   # concat line with a string

  which is not working if a UnicodeError is raised: in such case line is
  not decoded and line is not converted in a string and the
  concatenation with the string fails. We should ensure that line is
  converted to a string

  [1] https://github.com/openstack/python-neutronclient/commit/fcf289797c063088f9003359dfd1c7d4f41ed5ef
  [2] https://github.com/openstack/python-neutronclient/blob/db7eb557403da7c0e1eca7e12f6ddab6bc0d1fc1/neutronclient/tests/unit/test_cli20.py#L77-L81

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