GNOME Bugzilla – Bug 668864
rhythmbox-2.95 lyrics plugin fails to save edited lyrics with gtk3 introspection (pygobject-3.0.3, gtk+-3.2.3)
Last modified: 2012-02-01 21:32:41 UTC
Modifying the text and pressing "save" in the lyrics panel results in TypeError: get_text() takes exactly 4 arguments (3 given) Traceback (most recent call last):
+ Trace 229540
save_callback()
text = buf.get_text(startiter, enditer)
return info.invoke(*args, **kwargs)
This is due to a third argument "gboolean include_hidden_chars" being required. It can be fixed by the following simple patch to /usr/lib/rhythmbox/plugins/lyrics/lyrics.py: === modified file 'lyrics.py' --- lyrics.py 2012-01-26 13:15:55 +0000 +++ lyrics.py 2012-01-26 13:16:08 +0000 @@ -199,7 +199,7 @@ buf = self.buffer startiter = buf.get_start_iter() enditer = buf.get_end_iter() - text = buf.get_text(startiter, enditer) + text = buf.get_text(startiter, enditer, False) save_lyrics(self.cache_path, text) self.get_lyrics() Reference: Gentoo bug https://bugs.gentoo.org/show_bug.cgi?id=400911
Can you elaborate what pygtk has to do here, as configure.ac does not list any dependency for pygtk but only pygobject? Did you mean pygobject instead? (Also, attaching patches as attachments is prefered as they can be searched for in the Bugzilla query, and are listed and linked on the product overview page.)
Sorry, I'm (In reply to comment #1) > Can you elaborate what pygtk has to do here, as configure.ac does not list any > dependency for pygtk but only pygobject? Did you mean pygobject instead? Sorry, as I understand now pygtk is now replaced / implemented via pygobject. To clarify I opened a python console in rb and did: from gi.repository import Gtk Gtk and got: <gi.module.DynamicModule 'Gtk' from '/usr/lib/girepository-1.0/Gtk-3.0.typelib'> so it's probably also not pygobject requiring three arguments but simply GTK3: qfile -v /usr/lib/girepository-1.0/Gtk-3.0.typelib results in: x11-libs/gtk+-3.2.3 (/usr/lib/girepository-1.0/Gtk-3.0.typelib) > (Also, attaching patches as attachments is prefered as they can be searched for > in the Bugzilla query, and are listed and linked on the product overview page.) I'll happily fix the bug header and attach a patch file once the bug is confirmed. Thanks!
(In reply to comment #0) > Modifying the text and pressing "save" in the lyrics panel results in > TypeError: get_text() takes exactly 4 arguments (3 given) > Traceback (most recent call last): >
Created attachment 206571 [details] [review] Patch for /usr/lib/rhythmbox/plugins/lyrics/lyrics.py to use 3-argument get_text Set the third argument to True because that's the default for pygtk, cf. http://www.pygtk.org/docs/pygtk/class-gtktextbuffer.html#method-gtktextbuffer--get-text
Review of attachment 206571 [details] [review]: pushed as commit a200004, thanks