openlp-core team mailing list archive
-
openlp-core team
-
Mailing list archive
-
Message #19975
[Merge] lp:~phill-ridout/openlp/bug1154059_2.0 into lp:openlp/2.0
Phill has proposed merging lp:~phill-ridout/openlp/bug1154059_2.0 into lp:openlp/2.0.
Requested reviews:
Andreas Preikschat (googol)
Related bugs:
Bug #1154059 in OpenLP: "OpenLP does not start due to mimetypes bug"
https://bugs.launchpad.net/openlp/+bug/1154059
For more details, see:
https://code.launchpad.net/~phill-ridout/openlp/bug1154059_2.0/+merge/153476
Fixes #1154059 catching Unicode decode error.
Changed extension to *.* rather than just *
--
https://code.launchpad.net/~phill-ridout/openlp/bug1154059_2.0/+merge/153476
Your team OpenLP Core is subscribed to branch lp:openlp/2.0.
=== modified file 'openlp/core/ui/media/phononplayer.py'
--- openlp/core/ui/media/phononplayer.py 2012-12-30 19:41:24 +0000
+++ openlp/core/ui/media/phononplayer.py 2013-03-14 22:19:21 +0000
@@ -69,13 +69,20 @@
self.display_name = u'&Phonon'
self.parent = parent
self.additional_extensions = ADDITIONAL_EXT
- mimetypes.init()
- for mimetype in Phonon.BackendCapabilities.availableMimeTypes():
- mimetype = unicode(mimetype)
- if mimetype.startswith(u'audio/'):
- self._addToList(self.audio_extensions_list, mimetype)
- elif mimetype.startswith(u'video/'):
- self._addToList(self.video_extensions_list, mimetype)
+ try:
+ mimetypes.init()
+ for mimetype in Phonon.BackendCapabilities.availableMimeTypes():
+ mimetype = unicode(mimetype)
+ if mimetype.startswith(u'audio/'):
+ self._addToList(self.audio_extensions_list, mimetype)
+ elif mimetype.startswith(u'video/'):
+ self._addToList(self.video_extensions_list, mimetype)
+ # Work around for http://bugs.python.org/issue9291
+ except UnicodeDecodeError:
+ log.exception(u'UnicodeDecodeError when trying to read mime types.'
+ 'Setting extensions to all files')
+ self.audio_extensions_list = [u'*.*']
+ self.video_extensions_list = [u'*.*']
def _addToList(self, list, mimetype):
# Add all extensions which mimetypes provides us for supported types.
Follow ups