From 5e8efc14f72b8aa54bce45c3fdc8bc8d626b70bf Mon Sep 17 00:00:00 2001 From: Peter Landgren Date: Sat, 20 Feb 2010 09:20:12 +0000 Subject: [PATCH] Fix of issue 3625 for path with ASCII characters. Working on the problem with non ASCII characters. svn: r14413 --- src/plugins/view/mediaview.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/plugins/view/mediaview.py b/src/plugins/view/mediaview.py index c7a845f38..516bf4b30 100644 --- a/src/plugins/view/mediaview.py +++ b/src/plugins/view/mediaview.py @@ -51,6 +51,7 @@ from gui.views.listview import ListView from gui.views.treemodels import MediaModel import ThumbNails import const +import constfunc import config import Utils import Bookmarks @@ -205,6 +206,13 @@ class MediaView(ListView): if not gen.mime.is_valid_type(mime): return photo = gen.lib.MediaObject() + #If in Windows, the url from urlparse.urlparse(d) above is incorrect + # It leaves a "/" first in the url and this is not a valid Windows path/file name. + if constfunc.win(): + if name[0] == "/": + name = name[1:] + # Then replace all %20 with a space + name = name.replace('%20',' ') photo.set_path(name) photo.set_mime_type(mime) basename = os.path.basename(name)