Comment 10 for bug 1503415

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-neutronclient (stable/liberty)

Reviewed: https://review.openstack.org/252876
Committed: https://git.openstack.org/cgit/openstack/python-neutronclient/commit/?id=c5e1d2b827e16b761aa9601355fc91d969527d73
Submitter: Jenkins
Branch: stable/liberty

commit c5e1d2b827e16b761aa9601355fc91d969527d73
Author: Cedric Brandily <email address hidden>
Date: Tue Oct 6 22:22:09 2015 +0200

    Ensure to decode bytes or fail

    The commit fcf289797c063088f9003359dfd1c7d4f41ed5ef introduces the
    pattern:

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

    which is not working in PY3K if an UnicodeError is raised because line
    is not decoded and concatened to a string.

    This change delegates decoding to safe_decode[1] which returns a text
    object or raises an error.

    [1] oslo_utils.encodeutils

    Closes-Bug: #1503415
    Related-Bug: #1499004
    Change-Id: I16b8013f33aa3efad65be8040d3210120e047bbd
    (cherry picked from commit 88eb5845b77fa06a12c096706093329f82dba54c)