2014-07-03, 21:16
I encountered another unicode issue during playlist lookup (branch doesn't solve it):
It fails on files with non-ascii characters in name. Script scans whole special://skin/extras/ where I have studio flags with a lot of unicode names and I guess users can easily have playlist with unicode names too. I removed decode( 'utf-8' ) part and it solved issue for me, but i can't say if it's right or not because my Python knowledge is only "passive" .
Another request: is it possible to return skin playlists as special path (either special://skin/playlists/ or special://skin/extras/ what is looked up) instead of full path? Profile playlists are already returned as special://profile/playlists/video/. It's issue for me because I'm using playlist special path for visibility condition in skin.
Code:
20:56:15 T:6288 DEBUG: script.skinshortcuts: Failed to load playlists
20:56:15 T:6288 ERROR: Traceback (most recent call last):
20:56:15 T:6288 ERROR: File "C:\Users\<...>\AppData\Roaming\XBMC\addons\script.skinshortcuts\resources\lib\library.py", line 1359, in playlists
20:56:15 T:6288 ERROR: playlistfile = os.path.join( root, file ).decode( 'utf-8' )
20:56:15 T:6288 ERROR: File "C:\Program Files (x86)\XBMC\system\python\Lib\encodings\utf_8.py", line 16, in decode
20:56:15 T:6288 ERROR: return codecs.utf_8_decode(input, errors, True)
20:56:15 T:6288 ERROR: UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 95: ordinal not in range(128)
It fails on files with non-ascii characters in name. Script scans whole special://skin/extras/ where I have studio flags with a lot of unicode names and I guess users can easily have playlist with unicode names too. I removed decode( 'utf-8' ) part and it solved issue for me, but i can't say if it's right or not because my Python knowledge is only "passive" .
Another request: is it possible to return skin playlists as special path (either special://skin/playlists/ or special://skin/extras/ what is looked up) instead of full path? Profile playlists are already returned as special://profile/playlists/video/. It's issue for me because I'm using playlist special path for visibility condition in skin.