Merge lp:~phill-ridout/openlp/bug1154059_2.0 into lp:openlp/2.0

Proposed by Phill
Status: Merged
Approved by: Andreas Preikschat
Approved revision: 2143
Merged at revision: 2139
Proposed branch: lp:~phill-ridout/openlp/bug1154059_2.0
Merge into: lp:openlp/2.0
Diff against target: 31 lines (+14/-7)
1 file modified
openlp/core/ui/media/phononplayer.py (+14/-7)
To merge this branch: bzr merge lp:~phill-ridout/openlp/bug1154059_2.0
Reviewer Review Type Date Requested Status
Andreas Preikschat (community) Approve
Raoul Snyman Approve
Review via email: mp+153476@code.launchpad.net

This proposal supersedes a proposal from 2013-03-12.

Description of the change

Fixes #1154059 catching Unicode decode error.
Changed extension to *.* rather than just *

To post a comment you must log in.
Revision history for this message
Andreas Preikschat (googol-deactivatedaccount) wrote : Posted in a previous version of this proposal

I think this
27 + self.audio_extensions_list = [u'*']
28 + self.video_extensions_list = [u'*']

should rather be

self.audio_extensions_list = [u'*.*']
self.video_extensions_list = [u'*.*']

review: Needs Fixing
Revision history for this message
Andreas Preikschat (googol-deactivatedaccount) wrote : Posted in a previous version of this proposal

Why do you assume that this is a python bug? Because Phonon.BackendCapabilities.availableMimeTypes() is related to Qt.

Revision history for this message
Phill (phill-ridout) wrote : Posted in a previous version of this proposal

I though that about the *.*, but if you look in the filter combo box all
files is listed as just '*' so I went with that. Tell me if you still want
me to change this.

I came to the conclusion that it was a python bug as the traceback is
similar to: http://bugs.python.org/issue9291 see the linked (
https://bugs.launchpad.net/openlp/+bug/1154059) bug report.

<email address hidden> - Google Talk
phillr_97 - Skype

On 13 March 2013 17:02, Andreas Preikschat <email address hidden>wrote:

> Why do you assume that this is a python bug? Because
> Phonon.BackendCapabilities.availableMimeTypes() is related to Qt.
> --
>
> https://code.launchpad.net/~phill-ridout/openlp/bug1154059_2.0/+merge/153024
> You are the owner of lp:~phill-ridout/openlp/bug1154059_2.0.
>

Revision history for this message
Raoul Snyman (raoul-snyman) wrote :

One minor concern for me is how you're just discarding all the filters, but I do see the practical aspect of it, so I guess this is an acceptable approach.

review: Approve
Revision history for this message
Andreas Preikschat (googol-deactivatedaccount) wrote :

> One minor concern for me is how you're just discarding all the filters
Same here :)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== 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 @@
69 self.display_name = u'&Phonon'69 self.display_name = u'&Phonon'
70 self.parent = parent70 self.parent = parent
71 self.additional_extensions = ADDITIONAL_EXT71 self.additional_extensions = ADDITIONAL_EXT
72 mimetypes.init()72 try:
73 for mimetype in Phonon.BackendCapabilities.availableMimeTypes():73 mimetypes.init()
74 mimetype = unicode(mimetype)74 for mimetype in Phonon.BackendCapabilities.availableMimeTypes():
75 if mimetype.startswith(u'audio/'):75 mimetype = unicode(mimetype)
76 self._addToList(self.audio_extensions_list, mimetype)76 if mimetype.startswith(u'audio/'):
77 elif mimetype.startswith(u'video/'):77 self._addToList(self.audio_extensions_list, mimetype)
78 self._addToList(self.video_extensions_list, mimetype)78 elif mimetype.startswith(u'video/'):
79 self._addToList(self.video_extensions_list, mimetype)
80 # Work around for http://bugs.python.org/issue9291
81 except UnicodeDecodeError:
82 log.exception(u'UnicodeDecodeError when trying to read mime types.'
83 'Setting extensions to all files')
84 self.audio_extensions_list = [u'*.*']
85 self.video_extensions_list = [u'*.*']
7986
80 def _addToList(self, list, mimetype):87 def _addToList(self, list, mimetype):
81 # Add all extensions which mimetypes provides us for supported types.88 # Add all extensions which mimetypes provides us for supported types.

Subscribers

People subscribed via source and target branches