diff options
Diffstat (limited to 'module/plugins/internal')
| -rw-r--r-- | module/plugins/internal/UnRar.py | 20 | 
1 files changed, 10 insertions, 10 deletions
diff --git a/module/plugins/internal/UnRar.py b/module/plugins/internal/UnRar.py index ce271bec4..b3c2fe6af 100644 --- a/module/plugins/internal/UnRar.py +++ b/module/plugins/internal/UnRar.py @@ -19,11 +19,10 @@  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_encode +from module.utils.fs import save_join, decode, fs_decode, fs_encode  from module.plugins.internal.AbstractExtractor import AbtractExtractor, WrongPassword, ArchiveError, CRCError  class UnRar(AbtractExtractor): @@ -39,7 +38,7 @@ class UnRar(AbtractExtractor):      @staticmethod      def checkDeps():          if os.name == "nt": -            UnRar.CMD = save_join(pypath, "UnRAR.exe") +            UnRar.CMD = safe_join(pypath, "UnRAR.exe")              p = Popen([UnRar.CMD], stdout=PIPE, stderr=PIPE)              p.communicate()          else: @@ -66,9 +65,9 @@ class UnRar(AbtractExtractor):              if match:                  #only add first parts                  if int(match[0][1]) == 1: -                    result.append((file, id)) +                    result.append((fs_decode(file), id))              else: -                result.append((file, id)) +                result.append((fs_decode(file), id))          return result @@ -135,9 +134,9 @@ class UnRar(AbtractExtractor):      def getDeleteFiles(self): -        if ".part" in self.file: -            return glob(re.sub("(?<=\.part)([01]+)", "*", self.file, re.IGNORECASE)) -        return [self.file] +        if ".part" in fs_encode(self.file): +            return glob(re.sub("(?<=\.part)([01]+)", "*", fs_decode(self.file), re.IGNORECASE)) +        return [fs_decode(self.file)]      def listContent(self):          command = "vb" if self.fullpath else "lb" @@ -176,7 +175,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(call)) +        self.m.logDebug(" ".join([decode(a) for a in call]))          p = Popen(call, stdout=PIPE, stderr=PIPE) @@ -188,4 +187,5 @@ def renice(pid, value):          try:              Popen(["renice", str(value), str(pid)], stdout=PIPE, stderr=PIPE, bufsize=-1)          except: -            print "Renice failed"
\ No newline at end of file +            print "Renice failed" +  | 
