From 968b4a882d3678f0b7083f769b8d2a814307b8ac Mon Sep 17 00:00:00 2001 From: Helge Herz Date: Sat, 2 Mar 2013 13:44:04 +0000 Subject: [PATCH] adaption for python version less 3.x (see issue 6465) for details svn: r21516 --- gramps/plugins/view/mediaview.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/gramps/plugins/view/mediaview.py b/gramps/plugins/view/mediaview.py index 89f29c32f..5b5fe2db3 100644 --- a/gramps/plugins/view/mediaview.py +++ b/gramps/plugins/view/mediaview.py @@ -184,17 +184,17 @@ class MediaView(ListView): if not sel_data: return #modern file managers provide URI_LIST. For Windows split sel_data.data - if win(): - files = sel_data.data.split('\n') - else: - files = sel_data.get_uris() + files = sel_data.get_uris() for file in files: clean_string = fix_encoding( file.replace('\0',' ').replace("\r", " ").strip()) protocol, site, mfile, j, k, l = urlparse(clean_string) if protocol == "file": - name = cuni(url2pathname( + if sys.version_info[0] < 3: + name = cuni(url2pathname( mfile.encode(glocale.getfilesystemencoding()))) + else: + name = cuni(url2pathname(mfile)) mime = get_type(name) if not is_valid_type(mime): return