mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
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>
This commit is contained in:
@@ -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))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user