From 04d7669948400497e3b5e067893affaa63c14586 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Mon, 5 Dec 2011 21:40:56 +0000 Subject: [PATCH] Fix non-ascii file check on Macs --- openlp/core/ui/mainwindow.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index 663f6c75a..0974f53fb 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -720,8 +720,10 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): args = [] for a in self.arguments: args.extend([a]) - self.serviceManagerContents.loadFile(unicode(args[0], - sys.getfilesystemencoding())) + filename = args[0] + if not isinstance(filename, unicode): + filename = unicode(filename, sys.getfilesystemencoding()) + self.serviceManagerContents.loadFile(filename) elif QtCore.QSettings().value( self.generalSettingsSection + u'/auto open', QtCore.QVariant(False)).toBool():