2013-01-23, 07:28
(2013-01-09, 13:28)ghizzu Wrote:(2013-01-09, 02:44)MadPriest Wrote: this is from a message i posted 3 days ago
noone got the answers?
Code:19:15:47 T:2750528320 ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <type 'exceptions.UnicodeDecodeError'>
Error Contents: 'ascii' codec can't decode byte 0xd1 in position 7: ordinal not in range(128)
Traceback (most recent call last):
File "/home/igalsc/.xbmc/addons/plugin.video.youtube/default.py", line 111, in <module>
navigation.listMenu(params)
File "/home/igalsc/.xbmc/addons/plugin.video.youtube/YouTubeNavigation.py", line 109, in listMenu
return self.list(params)
File "/home/igalsc/.xbmc/addons/plugin.video.youtube/YouTubeNavigation.py", line 184, in list
(results, status) = self.storage.list(params)
File "/home/igalsc/.xbmc/addons/plugin.video.youtube/YouTubeStorage.py", line 53, in list
return self.getStoredSearches(params)
File "/home/igalsc/.xbmc/addons/plugin.video.youtube/YouTubeStorage.py", line 112, in getStoredSearches
thumbnail = self.retrieveSettings(params, "thumbnail", item)
File "/home/igalsc/.xbmc/addons/plugin.video.youtube/YouTubeStorage.py", line 476, in retrieveSettings
key = self.getStorageKey(params, type, item)
File "/home/igalsc/.xbmc/addons/plugin.video.youtube/YouTubeStorage.py", line 249, in getStorageKey
return self._getThumbnailStorageKey(params, item)
File "/home/igalsc/.xbmc/addons/plugin.video.youtube/YouTubeStorage.py", line 299, in _getThumbnailStorageKey
return key.encode("utf-8","ignore")
UnicodeDecodeError: 'ascii' codec can't decode byte 0xd1 in position 7: ordinal not in range(128)
-->End of Python script error report<--
Try this:
in YouTubeStorage.py find this line:
and replace it with this one:Code:return key.encode("utf-8","ignore")
Code:return key.decode("utf-8").encode("utf-8","ignore")
It should work (don't ask me why)
Hi,
I had the same problem. I have implemented following lines right after import statements in default.py:
Code:
reload(sys);
sys.setdefaultencoding("utf-8");
This should prevent all this kind of unicode ascii errors in future in all modules. Please implement it in master.
What it does is that it will reload sys module which seems to be loaded with ascii as default encoding even though it will print "utf-8" if you try print(sys.getdefaultencoding()) before this lines. I had the same problem in my plugins and this solved the issue when localizing them without rewriting lots of code.