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 533644 - No argument checking in gtk.Action.set_tool_item_type()
No argument checking in gtk.Action.set_tool_item_type()
Status: RESOLVED FIXED
Product: pygtk
Classification: Bindings
Component: gtk
unspecified
Other Linux
: Normal trivial
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
Depends on:
Blocks:
 
 
Reported: 2008-05-17 23:25 UTC by Björn Lindqvist
Modified: 2008-06-22 20:17 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
extra check, fixing this (1.22 KB, patch)
2008-05-18 15:55 UTC, Paul Pogonyshev
reviewed Details | Review
fix + unit test (3.51 KB, patch)
2008-06-21 20:03 UTC, Paul Pogonyshev
committed Details | Review

Description Björn Lindqvist 2008-05-17 23:25:59 UTC
PyGTK runs this code without complaint:

  action = gtk.Action('name', 'action', 'tooltip', None)
  action.set_tool_item_type(None)

It should raise either a TypeError or ValueError on action.set_tool_item_type(None). Your app will probably crash on action.create_tool_item() because None isn't a gtk.ToolItem subclass.
Comment 1 Paul Pogonyshev 2008-05-18 15:55:20 UTC
Created attachment 111101 [details] [review]
extra check, fixing this

Note that the patch is larger than it could be because I fixed indentation in that function along the way.  In fact, only one if() is new.
Comment 2 Johan (not receiving bugmail) Dahlin 2008-06-21 18:37:20 UTC
Comment on attachment 111101 [details] [review]
extra check, fixing this

Looks good but could use a test.
Comment 3 Paul Pogonyshev 2008-06-21 20:03:49 UTC
Created attachment 113180 [details] [review]
fix + unit test
Comment 4 Paul Pogonyshev 2008-06-22 20:17:37 UTC
Sending        ChangeLog
Sending        gtk/gtk.override
Sending        tests/test_actiongroup.py
Transmitting file data ...
Committed revision 2997.