more unicode fixes: os.path functions use unicode depending on the OS

This commit is contained in:
marcelveldt 2016-01-18 12:05:05 +01:00
parent 2bd1d139c1
commit eae4fea76a
7 changed files with 30 additions and 13 deletions

View file

@ -76,7 +76,10 @@ class ClientInfo():
return clientId
addon_path = self.addon.getAddonInfo('path').decode('utf-8')
GUID_file = xbmc.translatePath(os.path.join(addon_path, "machine_guid")).decode('utf-8')
if os.path.supports_unicode_filenames:
GUID_file = xbmc.translatePath(os.path.join(addon_path, "machine_guid")).decode('utf-8')
else:
GUID_file = xbmc.translatePath(os.path.join(addon_path.encode("utf-8"), "machine_guid")).decode('utf-8')
try:
GUID = xbmcvfs.File(GUID_file)