GNOME Bugzilla – Bug 651962
GdkPixbuf.Pixbuf.new_from_xpm_data() not works (TypeError: argument 1: Must be string, not list)
Last modified: 2012-07-30 06:39:29 UTC
PyGTK code (works): $ python -c 'import gtk; gtk.gdk.pixbuf_new_from_xpm_data (["1 1 1 1", " c #000000", " "])' PyGI code (not works): $ python -c 'from gi.repository import GdkPixbuf; GdkPixbuf.Pixbuf.new_from_xpm_data (["1 1 1 1", " c #000000", " "])' Traceback (most recent call last):
+ Trace 227388
return info.invoke(cls, *args)
PyGObject version: 2.28.4 gdk-pixbuf version: 2.23.3
I'm not sure if we support arrays of strings. I will have to check on this but most likely we will have to add the functionality.
The problem is still present with pygobject 3.2.0.
I just ran into this. Also note it crashes when trying to pass a continuous string: $ python -c 'from gi.repository import GdkPixbuf; GdkPixbuf.Pixbuf.new_from_xpm_data ("1 1 1 1 c #000000 ")' This might be related (which has a pending patch): https://bugzilla.gnome.org/show_bug.cgi?id=668956
Martin, Thanks for pushing https://bugzilla.gnome.org/show_bug.cgi?id=668956 I've verified it fixes the problem described here. Passing a list of strings to new_from_xpm_data works and passing a continuous string raises a type error.
Indeed, thanks for verifying! I tested it myself as well. *** This bug has been marked as a duplicate of bug 668956 ***