I have a warning when I run my GTK (Python GObject introspection) application and I can't figure out its source. When the application is loading and I'm populating a GtkListStore, after the very first time I append a row, I get the following warning:
/usr/lib/python2.7/site-packages/gi/types.py:44: Warning: g_object_set_qdata: assertion `G_IS_OBJECT (object)' failed
return info.invoke(*args)
The rest of the rows append without any further warnings. In fact, it's always only raised once, always on the first item to be appended. But, the actual contents of the row don't seem to matter; it raise the warning no matter what. When the program finishes loading, all of the rows seem to be ok when I browse them in the TreeView.
My list store looks like this:
self.list_store = Gtk.ListStore(bool, str, str, str, str, str, str,
str, str, str, str, GdkPixbuf.Pixbuf,
str, str, str, object, Pango.Weight)
The last few columns are hidden from the associated GtkTreeView, but the warning occurs before the TreeView is created, so I'm sure it's coming from the ListStore.Needless to say, I'm sure that all the rows I'm passing are in the correct format since, like I said, the warning is always raised after the first row, no matter which row I add first.
Does anyone have any idea what could be causing this? It's not preventing my application from running, so it's not an emergency, but I'd rather not have it spitting out warnings for the end user.
Edit:
I confirmed using Python's -W all
commandline argument that the warning is actually being raised for all rows.
I tried stepping into the append()
method using pdb
but, interstingly, it gets stuck in a loop in the gi
code when it tries setting the value of the column containing the GdkPixbuf, so I never actually see the warning raised when debugging the program. My guess is that the Pixbuf is causing the problem, but I have no idea how to change it to get rid of the warning. The Pixbuf renders correctly in the TreeView, so I'm not sure what is going on.
-W all
commandline argument, I confirmed that the warning is indeed happening for each row being added. – Impaletraceback
module doesn't seem to help since it's a warning and not an exception; I can't seem to capture the stack in which the warning occurs. I could use thewarnings
module to force warnings to be raised as exceptions, but this code is happening in a thread andwarnings
is not thread-safe. Any tips would be appreciated. – Impalewarnings
isn't thread-safe. But wouldn't the exception still get raised? – Brennemanwarnings
alters the global context, I wouldn't risk it. – Impale