summaryrefslogtreecommitdiffstats
path: root/ipalib
diff options
context:
space:
mode:
authorMartin Basti <mbasti@redhat.com>2017-01-12 16:20:43 +0100
committerMartin Basti <mbasti@redhat.com>2017-01-24 13:25:47 +0100
commit18337bf7f7c31a47fe0c7280f82fca043b548bd5 (patch)
tree4878fdfa1a49582d93249bcc8ce157dd9bba1ac2 /ipalib
parent0eb5a0e0ec2d232d2921ae5f9e8d0885146a5610 (diff)
downloadfreeipa-18337bf7f7c31a47fe0c7280f82fca043b548bd5.tar.gz
freeipa-18337bf7f7c31a47fe0c7280f82fca043b548bd5.tar.xz
freeipa-18337bf7f7c31a47fe0c7280f82fca043b548bd5.zip
py3: decode bytes for json.loads()
In py 3.5 json.loads requires to have string as input, all bytes must be decoded. Note: python 3.6 supports bytes for json.loads() https://fedorahosted.org/freeipa/ticket/4985 Reviewed-By: Christian Heimes <cheimes@redhat.com> Reviewed-By: Jan Cholasta <jcholast@redhat.com>
Diffstat (limited to 'ipalib')
-rw-r--r--ipalib/rpc.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/ipalib/rpc.py b/ipalib/rpc.py
index 921f5cb4b..fb739f8f4 100644
--- a/ipalib/rpc.py
+++ b/ipalib/rpc.py
@@ -1101,7 +1101,8 @@ class JSONServerProxy(object):
)
try:
- response = json_decode_binary(json.loads(response.decode('ascii')))
+ response = json_decode_binary(
+ json.loads(response.decode('utf-8')))
except ValueError as e:
raise JSONError(error=str(e))