GNOME Bugzilla – Bug 742480
[treemodel_filetree.py] The (pygobject) GTK Python demo for Tree Models fails with the error: "There is a disparity between the internal view of the GtkTreeView"
Last modified: 2018-01-10 20:48:48 UTC
I have been trying to run the demo for the TreeView in Python3. But it fails every time with the error: "There is a disparity between the internal view of the GtkTreeView". I've retrieved the script from here (I renamed it to demo_tree.py): https://git.gnome.org/browse/pygobject/tree/demos/gtk-demo/demos/TreeView/treemodel_filetree.py When running it, the window gets created, with a list of directories and files. When you open a FIRST level of directory, it works. When you open a SECOND level, at first it seems to work, but if you move the cursor/scroll it fails systematically with many messages such as displayed below, and the display in the window gets strange (white lines, strings randomly appearing/disappearing, etc): 1) messages with Python 2.7 (demo_tree.py:9386): Gtk-CRITICAL **: gtk_tree_path_to_string: assertion 'path != NULL' failed Traceback (most recent call last):
+ Trace 234513
return func(*args, **kargs)
next_data = self.on_iter_next(self.get_user_data(iter))
return self._held_refs[iter.user_data]
(demo_tree.py:9386): Gtk-CRITICAL **: /tmp/buildd/gtk+3.0-3.10.8~8+qiana/./gtk/gtktreeview.c:5411 (gtk_tree_view_bin_draw): assertion `has_next' failed. There is a disparity between the internal view of the GtkTreeView, and the GtkTreeModel. This generally means that the model has changed without letting the view know. Any display from now on is likely to be incorrect. 2) messages with Python 3.4 (demo_tree.py:10387): Gtk-CRITICAL **: gtk_tree_path_to_string: assertion 'path != NULL' failed Traceback (most recent call last): File "/usr/lib/python3/dist-packages/pygtkcompat/generictreemodel.py", line 60, in wrapped_func return func(*args, **kargs) File "/usr/lib/python3/dist-packages/pygtkcompat/generictreemodel.py", line 240, in do_iter_next next_data = self.on_iter_next(self.get_user_data(iter)) File "/usr/lib/python3/dist-packages/pygtkcompat/generictreemodel.py", line 154, in get_user_data return self._held_refs[iter.user_data] KeyError: 0 (demo_tree.py:10387): Gtk-CRITICAL **: /tmp/buildd/gtk+3.0-3.10.8~8+qiana/./gtk/gtktreeview.c:5411 (gtk_tree_view_bin_draw): assertion `has_next' failed. There is a disparity between the internal view of the GtkTreeView, and the GtkTreeModel. This generally means that the model has changed without letting the view know. Any display from now on is likely to be incorrect. ---- Please note that both Python 2.7 and 3.4 fail the same way. Of course, I was not modifying the filesystem during the test. I also tried changing the starting root from which the program lists the directories (from ~ to ~/<test_dir>), in which directory I created a small simple hierarchy of directories, it failed as well. The other demos seems to work (but they don't do the same task at all, of course). ---- I'm using Linux MINT 17 Cinnamon, 64 bits. Linux lm 3.13.0-24-generic #47-Ubuntu SMP Fri May 2 23:30:00 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux Regards.
Confirmed with master/3.25
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/pygobject/issues/95.