From ba7e369835fd247605a92d5c742f983cb0527358 Mon Sep 17 00:00:00 2001 From: angelblue05 Date: Fri, 29 Jan 2016 17:51:56 -0600 Subject: [PATCH] Revert deviceId changes Broke the deviceId generating part of the code since xbmcvfs.File doesn't cause an error, but instead returns an empty string. --- resources/lib/clientinfo.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/resources/lib/clientinfo.py b/resources/lib/clientinfo.py index 44ed98f2..54d29823 100644 --- a/resources/lib/clientinfo.py +++ b/resources/lib/clientinfo.py @@ -76,18 +76,15 @@ class ClientInfo(): return clientId addon_path = self.addon.getAddonInfo('path').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') + GUID_file = xbmc.translatePath(os.path.join(addon_path, "machine_guid")).decode('utf-8') try: - GUID = xbmcvfs.File(GUID_file) + GUID = open(GUID_file) except Exception as e: # machine_guid does not exists. self.logMsg("Generating a new deviceid: %s" % e, 1) clientId = str("%012X" % uuid4()) - GUID = xbmcvfs.File(GUID_file, 'w') + GUID = open(GUID_file, 'w') GUID.write(clientId) else: # machine_guid already exists. Get guid.