From 94518f257758836969db26042bc22c78ab8ddaf1 Mon Sep 17 00:00:00 2001 From: John Ralls Date: Sat, 19 Apr 2014 17:09:53 -0700 Subject: [PATCH] 7258: MediaEditor: Ensure that pathnames are always Unicode. --- gramps/gui/editors/editmedia.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/gramps/gui/editors/editmedia.py b/gramps/gui/editors/editmedia.py index 2609f115e..341c4c67f 100644 --- a/gramps/gui/editors/editmedia.py +++ b/gramps/gui/editors/editmedia.py @@ -42,6 +42,7 @@ from gi.repository import Gdk #------------------------------------------------------------------------- from gramps.gen.const import GRAMPS_LOCALE as glocale _ = glocale.translation.gettext +from gramps.gen.constfunc import conv_to_unicode from ..utils import open_file_with_default_application from gramps.gen.lib import MediaObject, NoteType from gramps.gen.db import DbTxn @@ -246,7 +247,7 @@ class EditMedia(EditPrimary): def select_file(self, val): self.determine_mime() path = self.file_path.get_text() - self.obj.set_path(get_unicode_path_from_file_chooser(path)) + self.obj.set_path(conv_to_unicode(path)) AddMediaObject(self.dbstate, self.uistate, self.track, self.obj, self._update_addmedia) @@ -293,8 +294,8 @@ class EditMedia(EditPrimary): ErrorDialog(msg1, msg2) self.ok_button.set_sensitive(True) return - - path = self.file_path.get_text() + + path = conv_to_unicode(self.file_path.get_text()) ref_obj = self.dbstate.db.get_object_from_handle(self.obj.handle) if ref_obj: media_path = media_path_full(self.dbstate.db,