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 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"
[treemodel_filetree.py] The (pygobject) GTK Python demo for Tree Models fails...
Status: RESOLVED OBSOLETE
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: 2015-01-06 19:50 UTC by Larry
Modified: 2018-01-10 20:48 UTC
See Also:
GNOME target: ---
GNOME version: 3.7/3.8



Description Larry 2015-01-06 19:50:57 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):
  • File "/usr/lib/python2.7/dist-packages/pygtkcompat/generictreemodel.py", line 60 in wrapped_func
    return func(*args, **kargs)
  • File "/usr/lib/python2.7/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/python2.7/dist-packages/pygtkcompat/generictreemodel.py", line 154 in get_user_data
    return self._held_refs[iter.user_data]
KeyError: 0

(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.
Comment 1 Christoph Reiter (lazka) 2017-04-03 08:45:50 UTC
Confirmed with master/3.25
Comment 2 GNOME Infrastructure Team 2018-01-10 20:48:48 UTC
-- 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.