KUDU-1653 - [python] Python 3 Failing to Deserialize Token Python 3 is failing to deserialize tokens because it is forcing it to decode in UTF-8. The serialized tokens should be left as byte strings to avoid this issue. This patch is tested by existing tests.
Change-Id: I1969d67fa75db28626e0d4e130f1d68a5fd3b1d5 Reviewed-on: http://gerrit.cloudera.org:8080/4542 Tested-by: Kudu Jenkins Reviewed-by: Todd Lipcon <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/kudu/repo Commit: http://git-wip-us.apache.org/repos/asf/kudu/commit/1c4dcabd Tree: http://git-wip-us.apache.org/repos/asf/kudu/tree/1c4dcabd Diff: http://git-wip-us.apache.org/repos/asf/kudu/diff/1c4dcabd Branch: refs/heads/master Commit: 1c4dcabddc1188e0881d6b35141cee1ec7171e7b Parents: 01bf011 Author: Jordan Birdsell <[email protected]> Authored: Tue Sep 27 08:11:28 2016 -0400 Committer: Todd Lipcon <[email protected]> Committed: Wed Sep 28 04:26:42 2016 +0000 ---------------------------------------------------------------------- python/kudu/client.pyx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/kudu/blob/1c4dcabd/python/kudu/client.pyx ---------------------------------------------------------------------- diff --git a/python/kudu/client.pyx b/python/kudu/client.pyx index bd37d2b..ebe2ff5 100644 --- a/python/kudu/client.pyx +++ b/python/kudu/client.pyx @@ -1407,7 +1407,7 @@ cdef class ScanToken: """ cdef string buf check_status(self._token.Serialize(&buf)) - return frombytes(buf) + return buf def deserialize_into_scanner(self, Client client, serialized_token): """ @@ -1426,7 +1426,7 @@ cdef class ScanToken: cdef: Scanner result = Scanner() KuduScanner* _scanner - check_status(self._token.DeserializeIntoScanner(client.cp, tobytes(serialized_token), &_scanner)) + check_status(self._token.DeserializeIntoScanner(client.cp, serialized_token, &_scanner)) result.scanner = _scanner return result
