UnicodeEncodeError
Jamie, Thanks for this great plugin I've been using it for a few weeks without any problems however something seems to have changed recently (possibly at the MUBI end?) as I am unable to access it anymore.
I've copied the error logs from Kodi below - maybe they can help clarify whether the issue relates to my installation or something else...
Please let me know if I can provide further detail. Cheers, David
22:30:53.414 T:3304059808 ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <type 'exceptions.UnicodeEncodeError'>
Error Contents: 'ascii' codec can't encode character u'\u2019' in position 96: ordinal not in range(128)
Traceback (most recent call last):
File "/storage/.kodi/addons/plugin.video.mubi/addon.py", line 12, in
Hi Jamie, same here. I am trying to get the addon to work but unfortunately I get the same error like David only with a different letter (u'\xf6'). My system is a RaspBerry Pi 3 B OSMC 2018.03-2 (Kernel: Linux 4.14.26-2-OSMC).
I would highly appreciate your reply as I really like your addon and your effort. Thanks in advance Thomas
here the log:
16:02:40.985 T:1374679808 ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <type 'exceptions.UnicodeEncodeError'>
Error Contents: 'ascii' codec can't encode character u'\xf6' in position 189: ordinal not in range(128)
Traceback (most recent call last):
File "/home/osmc/.kodi/addons/plugin.video.mubi/addon.py", line 12, in
This problem is caused by an incorrect handling of the downloaded JSON files. Mubi is now probaly sending emojis or country flags and this is revealing the issue.
To correct this try to change
json.loads(r.text)['country']
to
json.loads(r.text)['country'].encode("utf-8")
If this works one should sprinkle .encode everywhere.
Thanks for the suggestion. Unfortunately adding .encode("utf-8") as shown doesn't stop the exception and the same error as before is logged. Also tried adding .encode to some other json.loads statements without success.
I've the same exact problem, did you solved it perhaps?