summaryrefslogtreecommitdiffstats
path: root/module
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2011-12-16 10:51:01 +0100
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2011-12-16 10:51:01 +0100
commitce0e647e819fce4953552783021dbd15da3ce843 (patch)
treefda1d3b93efed80026b22c9ef37283a46306cb47 /module
parentpyLoad 0.4.9 (diff)
downloadpyload-ce0e647e819fce4953552783021dbd15da3ce843.tar.xz
encoding fix
Diffstat (limited to 'module')
-rw-r--r--module/Utils.py2
-rw-r--r--module/plugins/Plugin.py4
2 files changed, 4 insertions, 2 deletions
diff --git a/module/Utils.py b/module/Utils.py
index c965e33c4..8748b7693 100644
--- a/module/Utils.py
+++ b/module/Utils.py
@@ -43,7 +43,7 @@ def save_path(name):
def save_join(*args):
""" joins a path, encoding aware """
- return fs_encode(join(*[unicode(x) for x in args]))
+ return fs_encode(join(*[x if type(x) == unicode else decode(x) for x in args]))
# File System Encoding functions:
diff --git a/module/plugins/Plugin.py b/module/plugins/Plugin.py
index f7587d3f2..4b6396cbc 100644
--- a/module/plugins/Plugin.py
+++ b/module/plugins/Plugin.py
@@ -31,7 +31,7 @@ if os.name != "nt":
from itertools import islice
-from module.utils import save_join, save_path, fs_encode
+from module.utils import save_join, save_path, fs_encode, fs_decode
def chunks(iterable, size):
it = iter(iterable)
@@ -489,6 +489,8 @@ class Plugin(Base):
except Exception, e:
self.log.warning(_("Setting User and Group failed: %s") % str(e))
+ # convert back to unicode
+ location = fs_decode(location)
name = save_path(self.pyfile.name)
filename = join(location, name)