Reviewed: https://review.openstack.org/231700 Committed: https://git.openstack.org/cgit/openstack/python-neutronclient/commit/?id=88eb5845b77fa06a12c096706093329f82dba54c Submitter: Jenkins Branch: master
commit 88eb5845b77fa06a12c096706093329f82dba54c 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
Reviewed: https:/ /review. openstack. org/231700 /git.openstack. org/cgit/ openstack/ python- neutronclient/ commit/ ?id=88eb5845b77 fa06a12c0967060 93329f82dba54c
Committed: https:/
Submitter: Jenkins
Branch: master
commit 88eb5845b77fa06 a12c09670609332 9f82dba54c
Author: Cedric Brandily <email address hidden>
Date: Tue Oct 6 22:22:09 2015 +0200
Ensure to decode bytes or fail
The commit fcf289797c06308 8f9003359dfd1c7 d4f41ed5ef introduces the
pattern:
if isinstance(line, bytes): encoding= 'utf-8' )
try:
line = line.decode(
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 fad65be8040d321 0120e047bbd
Related-Bug: #1499004
Change-Id: I16b8013f33aa3e