Fix unicode error

Since we are not using self.logMsg, this is needed incase the path
contains unicode characters (window username)
This commit is contained in:
angelblue05 2015-10-21 16:30:52 -05:00
parent ca2b2745db
commit 6a9eddd413

View file

@ -20,12 +20,12 @@ class Lock:
break; break;
except OSError as e: except OSError as e:
if (time.time() - start_time) >= self.timeout: if (time.time() - start_time) >= self.timeout:
xbmc.log("File_Lock_On " + self.filename + " timed out") xbmc.log("File_Lock_On " + self.filename.encode('utf-8') + " timed out")
return False return False
#xbmc.log("File_Lock_On " + self.filename + " error " + str(e)) #xbmc.log("File_Lock_On " + self.filename + " error " + str(e))
time.sleep(self.delay) time.sleep(self.delay)
self.is_locked = True self.is_locked = True
xbmc.log("File_Lock_On " + self.filename + " obtained") xbmc.log("File_Lock_On " + self.filename.encode('utf-8') + " obtained")
return True return True
def release(self): def release(self):
@ -33,7 +33,7 @@ class Lock:
os.close(self.fd) os.close(self.fd)
os.unlink(self.filename) os.unlink(self.filename)
self.is_locked = False self.is_locked = False
xbmc.log("File_Lock_On " + self.filename + " released") xbmc.log("File_Lock_On " + self.filename.encode('utf-8') + " released")
def __del__(self): def __del__(self):
self.release() self.release()