summaryrefslogtreecommitdiffstats
path: root/module
diff options
context:
space:
mode:
authorGravatar Pedro Algarvio <pedro@algarvio.me> 2012-01-22 17:31:12 +0100
committerGravatar Pedro Algarvio <pedro@algarvio.me> 2012-01-22 17:31:12 +0100
commit5aa52ea8d5c3d28f350dc47d23d14f230be499eb (patch)
treeefb0b70e48b808137818230b483bf50aace1babd /module
parenttry to fix unrar encoding issues (diff)
downloadpyload-5aa52ea8d5c3d28f350dc47d23d14f230be499eb.tar.xz
Fix encoding issues in RAR plugin log messages
Diffstat (limited to 'module')
-rw-r--r--module/plugins/internal/UnRar.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/module/plugins/internal/UnRar.py b/module/plugins/internal/UnRar.py
index ce271bec4..ebb5cdbd6 100644
--- a/module/plugins/internal/UnRar.py
+++ b/module/plugins/internal/UnRar.py
@@ -23,7 +23,7 @@ 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_encode, fs_decode
from module.plugins.internal.AbstractExtractor import AbtractExtractor, WrongPassword, ArchiveError, CRCError
class UnRar(AbtractExtractor):
@@ -66,9 +66,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
@@ -136,8 +136,8 @@ class UnRar(AbtractExtractor):
def getDeleteFiles(self):
if ".part" in self.file:
- return glob(re.sub("(?<=\.part)([01]+)", "*", self.file, re.IGNORECASE))
- return [self.file]
+ return glob(re.sub("(?<=\.part)([01]+)", "*", fd_decode(self.file), re.IGNORECASE))
+ return [fs_decode(self.file)]
def listContent(self):
command = "vb" if self.fullpath else "lb"
@@ -176,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(call))
+ self.m.logDebug(" ".join([decode(arg) for arg in call]))
p = Popen(call, stdout=PIPE, stderr=PIPE)
@@ -188,4 +188,4 @@ 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"