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 691660 - 'treerow[idx] = None' complains 'Argument 3 does not allow None as a value'
'treerow[idx] = None' complains 'Argument 3 does not allow None as a value'
Status: RESOLVED DUPLICATE of bug 684094
Product: pygobject
Classification: Bindings
Component: general
3.4.x
Other Linux
: Normal normal
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
Depends on:
Blocks:
 
 
Reported: 2013-01-13 15:35 UTC by Cole Robinson
Modified: 2013-01-13 21:28 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Cole Robinson 2013-01-13 15:35:05 UTC
Trying to update a tree row with

treerow[idx] = None

fails like:

TypeError: Argument 3 does not allow None as a value

This convenience syntax maps to gtk_tree_store_set_value, so I tried the obvious:

diff --git a/gtk/gtktreestore.c b/gtk/gtktreestore.c
index 21e7a20..9830caf 100644
--- a/gtk/gtktreestore.c
+++ b/gtk/gtktreestore.c
@@ -937,7 +937,7 @@ gtk_tree_store_real_set_value (GtkTreeStore *tree_store,
  * @tree_store: a #GtkTreeStore
  * @iter: A valid #GtkTreeIter for the row being modified
  * @column: column number to modify
- * @value: new value for the cell
+ * @value: (allow-none): new value for the cell
  *
  * Sets the data in the cell specified by @iter and @column.
  * The type of @value must be convertible to the type of the


However that hits an assertion since it requires a gtk value.

All this worked with pygtk2 bindings. My usecase is a tooltip column: setting it to an empty string still shows an empty tooltip, so you want to be able to set None. Appending a row to a treestore doesn't complain about any None values.

Maybe this is entirely a gtk issue but since there seems to be some magic glue here I figured I'd try here first, please reassign if necessary.
Comment 1 Simon Feltman 2013-01-13 21:28:39 UTC
Thanks for the bug report. This particular bug has already been reported into our bug tracking system, but please feel free to report any further bugs you find.

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