From b9180617c9a1a8d8fcaa4345eaa3d16f81d14672 Mon Sep 17 00:00:00 2001 From: RaNaN Date: Fri, 26 Nov 2010 23:58:05 +0100 Subject: path browser encoding fix --- module/web/pyload/views.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/module/web/pyload/views.py b/module/web/pyload/views.py index cca337303..40d3b8207 100644 --- a/module/web/pyload/views.py +++ b/module/web/pyload/views.py @@ -8,6 +8,7 @@ from os import stat from os.path import isdir from os.path import isfile from os.path import join +from sys import getfilesystemencoding from urllib import unquote from itertools import chain from datetime import datetime @@ -407,6 +408,11 @@ def path(request, path, type): cwd = os.path.relpath(path) else: cwd = os.getcwd() + + try: + cwd = cwd.encode("utf8") + except: + pass cwd = os.path.normpath(os.path.abspath(cwd)) parentdir = os.path.dirname(cwd) @@ -429,6 +435,7 @@ def path(request, path, type): for f in folders: try: + f = f.decode(getfilesystemencoding()) data = {} data['name'] = f data['fullpath'] = os.path.join(cwd, f) -- cgit v1.2.3