Change in ovirt-engine-sdk[master]: Fix parsing of multi-byte UTF-8 characters

Code Review gerrit at ovirt.org
Thu Jun 15 08:49:51 UTC 2017


>From Ondra Machacek <omachace at redhat.com>:

Ondra Machacek has submitted this change and it was merged.

Change subject: Fix parsing of multi-byte UTF-8 characters
......................................................................


Fix parsing of multi-byte UTF-8 characters

Currently the Reader.read method assumes that strings need to be encoded
using UTF-8 before parsing them. This is only true in Python 3, where
strings are sequences of 16 bits characters. But it isn't true in Python
2, and trying to do so fails if the string is already encoded using
UTF-8. To avoid that this patch changes the Reader.read method so that
it only does this encoding when running with Python 3.

Change-Id: I6ab2764da91bfcd1bd50ebec228b2225eac2c446
Bug-Url: https://bugzilla.redhat.com/1461060
Signed-off-by: Juan Hernandez <juan.hernandez at redhat.com>
---
M sdk/lib/ovirtsdk4/reader.py
M sdk/tests/test_vm_reader.py
M sdk/tests/test_xml_reader.py
3 files changed, 43 insertions(+), 5 deletions(-)

Approvals:
  Ondra Machacek: Looks good to me, approved
  Juan Hernandez: Verified
  Jenkins CI: Passed CI tests



-- 
To view, visit https://gerrit.ovirt.org/78112
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I6ab2764da91bfcd1bd50ebec228b2225eac2c446
Gerrit-PatchSet: 4
Gerrit-Project: ovirt-engine-sdk
Gerrit-Branch: master
Gerrit-Owner: Juan Hernandez <juan.hernandez at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Juan Hernandez <juan.hernandez at redhat.com>
Gerrit-Reviewer: Ondra Machacek <omachace at redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation at ovirt.org>


More information about the Engine-commits mailing list