TypeError: Notify.Notification.set_icon_from_pixbuf() argument 1 must be gtk.gdk.Pixbuf, not None

Bug #909229 reported by Foppe Hemminga
18
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Exaile
Fix Released
Undecided
Dustin Spicuzza

Bug Description

Exaile 3.2.2
Ubuntu 11.10
Gnome3

I don't see any notification in Gnome3, but that's not the error. In console I saw:

Exception in thread Thread-24:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 552, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/threading.py", line 505, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/usr/share/exaile/plugins/notifyosd/__init__.py", line 108, in update_track_notify
    self.notify.set_icon_from_pixbuf(pixbuf)
TypeError: Notify.Notification.set_icon_from_pixbuf() argument 1 must be gtk.gdk.Pixbuf, not None

from the notify osd plugin. This happened after the playlist finished, which may be coincidal.

Looking at the code in "/usr/share/exaile/plugins/notifyosd/__init__.py", line 108 reveals the 'else' is not properly indented (4 spaces too deep). I haven't seen the error since, but as said, I can't fully test the plugin in Gnome3.

Foppe Hemminga (foppe)
description: updated
Revision history for this message
Foppe Hemminga (foppe) wrote :
Revision history for this message
Dustin Spicuzza (dustin-virtualroadside) wrote :

I don't think your patch is correct. Perhaps the correct fix would be to check for whether pixbuf is None, otherwise set some default pixbuf on it. If you move pixbuf up an indentation level, if it ever gets called there will be no pixbuf in that scope.

Revision history for this message
Foppe Hemminga (foppe) wrote :

This is likely not correct:

        if icon_allowed and self.cover:
            try:
                pixbuf = icons.MANAGER.pixbuf_from_data(self.cover)
            except glib.GError:
                pass
            else: # Wrong indentation
                self.notify.set_icon_from_pixbuf(pixbuf) # Wrong indentation
        self.notify.update(self.summary, self.body)

Revision history for this message
Mathias Brodala (mathbr) wrote :

No, this is perfectly fine Python code. Python supports the else statement for the try..except structure. The else branch is only accessed if there was no exception thrown: http://docs.python.org/tutorial/errors.html#handling-exceptions

Foppe Hemminga (foppe)
Changed in exaile:
status: New → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for Exaile because there has been no activity for 60 days.]

Changed in exaile:
status: Incomplete → Expired
Revision history for this message
Vincent Cheng (vincent-c) wrote :

Reopening bug. I'm not sure why it was marked as "Incomplete" in the first place, but I can still reproduce it reliably.

Test case:
1) Add mp3 file to playlist.
2) Then add ogg file to playlist, right after the mp3.
3) Play playlist.

Expected outcome:
Once the mp3 stops playing, Exaile should play the ogg file.

Actual outcome:
Exaile just stalls. Clicking on the play/pause button throws the exception shown in the bug description, i.e.:

Exception in thread Thread-17:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 551, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/threading.py", line 504, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/usr/share/exaile/plugins/notifyosd/__init__.py", line 108, in update_track_notify
    self.notify.set_icon_from_pixbuf(pixbuf)
TypeError: Notify.Notification.set_icon_from_pixbuf() argument 1 must be gtk.gdk.Pixbuf, not None

Changed in exaile:
status: Expired → Confirmed
Revision history for this message
Dustin Spicuzza (dustin-virtualroadside) wrote :

There were a lot of problems in the notify-osd plugin. Please checkout the trunk version of exaile and let me know if the problem reoccurs. Fixed in r3955.

Changed in exaile:
assignee: nobody → Dustin Spicuzza (dustin-virtualroadside)
status: Confirmed → Fix Committed
milestone: none → 0.3.3.0
Changed in exaile:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Patches

Remote bug watches

Bug watches keep track of this bug in other bug trackers.