Only decode JSON as utf-8.
Reviewed in https://codereview.appspot.com/12377043/.
This commit is contained in:
@@ -195,7 +195,6 @@ class BaseModel(Model):
|
|||||||
Raises:
|
Raises:
|
||||||
apiclient.errors.HttpError if a non 2xx response is received.
|
apiclient.errors.HttpError if a non 2xx response is received.
|
||||||
"""
|
"""
|
||||||
content = content.decode('utf-8')
|
|
||||||
self._log_response(resp, content)
|
self._log_response(resp, content)
|
||||||
# Error handling is TBD, for example, do we retry
|
# Error handling is TBD, for example, do we retry
|
||||||
# for some operation/error combinations?
|
# for some operation/error combinations?
|
||||||
@@ -258,6 +257,7 @@ class JsonModel(BaseModel):
|
|||||||
return simplejson.dumps(body_value)
|
return simplejson.dumps(body_value)
|
||||||
|
|
||||||
def deserialize(self, content):
|
def deserialize(self, content):
|
||||||
|
content = content.decode('utf-8')
|
||||||
body = simplejson.loads(content)
|
body = simplejson.loads(content)
|
||||||
if self._data_wrapper and isinstance(body, dict) and 'data' in body:
|
if self._data_wrapper and isinstance(body, dict) and 'data' in body:
|
||||||
body = body['data']
|
body = body['data']
|
||||||
|
|||||||
Reference in New Issue
Block a user