summaryrefslogtreecommitdiffstats
path: root/module/plugins/internal/UnRar.py
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins/internal/UnRar.py')
-rw-r--r--module/plugins/internal/UnRar.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/module/plugins/internal/UnRar.py b/module/plugins/internal/UnRar.py
index b3c2fe6af..ebb5cdbd6 100644
--- a/module/plugins/internal/UnRar.py
+++ b/module/plugins/internal/UnRar.py
@@ -19,10 +19,11 @@
import os
import re
+from os.path import join
from glob import glob
from subprocess import Popen, PIPE
-from module.utils.fs import save_join, decode, fs_decode, fs_encode
+from module.utils.fs import save_join, decode, fs_encode, fs_decode
from module.plugins.internal.AbstractExtractor import AbtractExtractor, WrongPassword, ArchiveError, CRCError
class UnRar(AbtractExtractor):
@@ -38,7 +39,7 @@ class UnRar(AbtractExtractor):
@staticmethod
def checkDeps():
if os.name == "nt":
- UnRar.CMD = safe_join(pypath, "UnRAR.exe")
+ UnRar.CMD = save_join(pypath, "UnRAR.exe")
p = Popen([UnRar.CMD], stdout=PIPE, stderr=PIPE)
p.communicate()
else:
@@ -134,8 +135,8 @@ class UnRar(AbtractExtractor):
def getDeleteFiles(self):
- if ".part" in fs_encode(self.file):
- return glob(re.sub("(?<=\.part)([01]+)", "*", fs_decode(self.file), re.IGNORECASE))
+ if ".part" in self.file:
+ return glob(re.sub("(?<=\.part)([01]+)", "*", fd_decode(self.file), re.IGNORECASE))
return [fs_decode(self.file)]
def listContent(self):
@@ -175,7 +176,7 @@ class UnRar(AbtractExtractor):
#NOTE: return codes are not reliable, some kind of threading, cleanup whatever issue
call = [self.CMD, command] + args + list(xargs)
- self.m.logDebug(" ".join([decode(a) for a in call]))
+ self.m.logDebug(" ".join([decode(arg) for arg in call]))
p = Popen(call, stdout=PIPE, stderr=PIPE)
@@ -188,4 +189,3 @@ def renice(pid, value):
Popen(["renice", str(value), str(pid)], stdout=PIPE, stderr=PIPE, bufsize=-1)
except:
print "Renice failed"
-