After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 651962 - GdkPixbuf.Pixbuf.new_from_xpm_data() not works (TypeError: argument 1: Must be string, not list)
GdkPixbuf.Pixbuf.new_from_xpm_data() not works (TypeError: argument 1: Must b...
Status: RESOLVED DUPLICATE of bug 668956
Product: pygobject
Classification: Bindings
Component: introspection
3.2.x
Other Linux
: Normal major
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
Depends on:
Blocks:
 
 
Reported: 2011-06-06 03:19 UTC by kakurasan
Modified: 2012-07-30 06:39 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description kakurasan 2011-06-06 03:19:58 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):
  • File "<string>", line 1 in <module>
  • File "/usr/lib/python2.7/dist-packages/gi/types.py", line 68 in constructor
    return info.invoke(cls, *args)
TypeError: argument 1: Must be string, not list

PyGObject version: 2.28.4
gdk-pixbuf version: 2.23.3
Comment 1 johnp 2011-06-08 17:03:11 UTC
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.
Comment 2 Sebastian Pölsterl 2012-04-21 13:27:48 UTC
The problem is still present with pygobject 3.2.0.
Comment 3 Simon Feltman 2012-07-29 20:15:54 UTC
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
Comment 4 Simon Feltman 2012-07-30 04:08:15 UTC
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.
Comment 5 Martin Pitt 2012-07-30 06:39:29 UTC
Indeed, thanks for verifying! I tested it myself as well.

*** This bug has been marked as a duplicate of bug 668956 ***