Skip to content

Commit 168c86c

Browse files
committed
Merge pull request kivy#4297 from kivy/get_bytes_instead_of_json_py3
fix error with py3 results returning wrong
2 parents 2adfb73 + 7fa3b69 commit 168c86c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

kivy/network/urlrequest.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,8 @@ def decode_result(self, result, resp):
406406
if content_type is not None:
407407
ct = content_type.split(';')[0]
408408
if ct == 'application/json':
409+
if isinstance(result, bytes):
410+
result = result.decode('utf-8')
409411
try:
410412
return loads(result)
411413
except:

0 commit comments

Comments
 (0)