Hi,
when I tried to perform a search (using exp1.2), I always ran into this python error:
Code:
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'\xdf' in position 26: ordinal not in range(128)
Traceback (most recent call last):
File "/home/kodi/.kodi/addons/plugin.audio.googlemusic.exp/default.py", line 84, in <module>
navigation.listMenu(params)
File "/home/kodi/.kodi/addons/plugin.audio.googlemusic.exp/GoogleMusicNavigation.py", line 66, in listMenu
listItems = self.getSearch(query)
File "/home/kodi/.kodi/addons/plugin.audio.googlemusic.exp/GoogleMusicNavigation.py", line 280, in getSearch
listItems.append(self.addFolderListItem(album[0],{'path':"search_result",'query':album[0]+' '+album[1]}))
File "/home/kodi/.kodi/addons/plugin.audio.googlemusic.exp/GoogleMusicNavigation.py", line 130, in addFolderListItem
url = "?".join([sys.argv[0],urllib.urlencode(params)])
File "/usr/lib/python2.7/urllib.py", line 1332, in urlencode
v = quote_plus(str(v))
UnicodeEncodeError: 'ascii' codec can't encode character u'\xdf' in position 26: ordinal not in range(128)
-->End of Python script error report<--
Seems urlencode has some trouble with unicode. I'm not very familiar with python but after some googling I found the following workaround that fixed it for me:
Code:
--- old/GoogleMusicNavigation.py 2014-10-16 16:30:32.000000000 +0200
+++ new/GoogleMusicNavigation.py 2014-12-29 19:12:47.513368708 +0100
@@ -127,7 +127,10 @@
def addFolderListItem(self, name, params, contextMenu=[], album_art_url=''):
li = self.xbmcgui.ListItem(label=name, iconImage=album_art_url, thumbnailImage=album_art_url)
li.addContextMenuItems(contextMenu, replaceItems=True)
+ str_params = {}
+ for p_key,p_value in params.iteritems():
+ str_params[p_key] = unicode(p_value).encode('utf-8')
- url = "?".join([sys.argv[0],urllib.urlencode(params)])
+ url = "?".join([sys.argv[0],urllib.urlencode(str_params)])
return url, li, "true"
def listPlaylistSongs(self, playlist_id):
edit: Unfortunately this workaround broke other things in artist / album lists etc.
Assume I should leave the bug fixing to someone with better python skills, will be glad to assist with testing and providing logs though.
-- wrayan