From 070be15e0d4bae7e957a33a2e7c7122c6747393e Mon Sep 17 00:00:00 2001 From: Benny Malengier Date: Wed, 7 Nov 2007 11:11:41 +0000 Subject: [PATCH] 2007-11-07 Benny Malengier * src/AddMedia.py: media crash, fix issue #1349, change unicode to Utils svn: r9316 --- ChangeLog | 3 +++ src/AddMedia.py | 9 +++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index c8f581aee..0e9b71fab 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +2007-11-07 Benny Malengier + * src/AddMedia.py: media crash, fix issue #1349, change unicode to Utils + 2007-11-06 Benny Malengier * src/plugins/all_relations.py: english issues * src/Relationship.py: english issues diff --git a/src/AddMedia.py b/src/AddMedia.py index 09c8225c8..17b51c736 100644 --- a/src/AddMedia.py +++ b/src/AddMedia.py @@ -135,8 +135,13 @@ class AddMediaObject(ManagedWindow.ManagedWindow): mobj.set_handle(Utils.create_id()) mobj.set_mime_type(None) else: - filename = unicode(self.file_text.get_filename(), - sys.getfilesystemencoding()) + if self.file_text.get_filename() is None: + msgstr = _("Import failed") + msgstr2 = _("The filename supplied could not be found.") + ErrorDialog(msgstr, msgstr2) + return + + filename = Utils.get_unicode_path(self.file_text.get_filename()) full_file = filename if self.relpath.get_active():