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 549191 - Constructor of gtk.TreeView raises TypeError when model is None
Constructor of gtk.TreeView raises TypeError when model is None
Status: RESOLVED FIXED
Product: pygobject
Classification: Bindings
Component: gobject
Git master
Other Linux
: Normal normal
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
Depends on:
Blocks:
 
 
Reported: 2008-08-24 11:04 UTC by Sebastian Pölsterl
Modified: 2008-08-27 21:42 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
fix (925 bytes, patch)
2008-08-25 19:08 UTC, Paul Pogonyshev
committed Details | Review

Description Sebastian Pölsterl 2008-08-24 11:04:17 UTC
I can call gtk.TreeView() without any argument and it works, but if I call gtk.TreeView(None) it doesn't and gives a TypeError:

TypeError: could not convert parameter 'model' of type 'GtkTreeModel'

This is especially annoying if you want to sub-class gtk.TreeView

class MyTreeView(gtk.TreeView):

    def __init__(self, model=None):
         gtk.TreeView.__init__(self, model) # Won't work if model is None

         ....
Comment 1 Paul Pogonyshev 2008-08-25 19:07:06 UTC
This is not specific to gtk.TreeModel actually.  Patch in a minute.
Comment 2 Paul Pogonyshev 2008-08-25 19:08:40 UTC
Created attachment 117359 [details] [review]
fix

Add handling of None to pyg_value_from_pygobject() in G_TYPE_INTERFACE branch.
Comment 3 Paul Pogonyshev 2008-08-27 21:42:32 UTC
Sending        ChangeLog
Sending        gobject/pygtype.c
Transmitting file data ..
Committed revision 954.

2008-08-28  Paul Pogonyshev  <pogonyshev@gmx.net>

	Bug 549191 – Constructor of gtk.TreeView raises TypeError when
	model is None

	* gobject/pygtype.c (pyg_value_from_pyobject): Handle None in
	G_TYPE_INTERFACE branch.