X-Git-Url: https://jfr.im/git/z_archive/twitter.git/blobdiff_plain/f7e6380227ca479157ce8d4e782772ca9b732b71..d5f58e6e509a562e021442f011ec6277a4a75561:/twitter/api.py diff --git a/twitter/api.py b/twitter/api.py index 9803c4b..f675822 100644 --- a/twitter/api.py +++ b/twitter/api.py @@ -142,17 +142,18 @@ class TwitterCall(object): uriBase += '?' + arg_data body = None else: - body = arg_data + body = arg_data.encode('utf8') req = urllib.request.Request(uriBase, body, headers) try: handle = urllib.request.urlopen(req) if "json" == self.format: - res = json.loads(handle.read()) + res = json.loads(handle.read().decode('utf8')) return wrap_response(res, handle.headers) else: - return wrap_response(str(handle.read()), handle.headers) + return wrap_response( + handle.read().decode('utf8'), handle.headers) except urllib.error.HTTPError as e: if (e.code == 304): return []