From 46ee502ad6fe7ed29efcb69088b7ec0125981bb3 Mon Sep 17 00:00:00 2001 From: Tomas Groth Date: Thu, 29 Jan 2015 21:20:36 +0000 Subject: [PATCH] Fix for chardet input. --- openlp/plugins/songs/lib/importers/presentationmanager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openlp/plugins/songs/lib/importers/presentationmanager.py b/openlp/plugins/songs/lib/importers/presentationmanager.py index c913fd232..b9df92961 100644 --- a/openlp/plugins/songs/lib/importers/presentationmanager.py +++ b/openlp/plugins/songs/lib/importers/presentationmanager.py @@ -48,7 +48,7 @@ class PresentationManagerImport(SongImport): except etree.XMLSyntaxError: # Try to detect encoding and use it file = open(file_path, mode='rb') - encoding = chardet.detect(file)['encoding'] + encoding = chardet.detect(file.read())['encoding'] tree = etree.parse(file_path, parser=etree.XMLParser(recover=True, encoding=encoding)) root = objectify.fromstring(etree.tostring(tree)) self.process_song(root)