Gtk.TreeModelSort does not init properly

Bug #1114406 reported by Sean Davis
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
pygobject
Fix Released
Medium
pygobject (Ubuntu)
Fix Released
Low
Unassigned

Bug Description

In python-gi, attempting to use Gtk.TreeModelSort(child_model), raises TypeError, saying it takes no arguments. This is incorrect. Gtk.TreeModelSort uses a child model as its argument.

This works correctly in both quantal and raring, but not precise. The init api is still the same from pyGTK... http://www.pygtk.org/docs/pygtk/class-gtktreemodelsort.html

Example code:

from gi.repository import Gtk

model = Gtk.ListStore(GdkPixbuf.Pixbuf, str, str, str, float, str, bool, bool)
sort = Gtk.TreeModelSort(model)

Raises:
TypeError: GObject.__init__() takes exactly 0 arguments (1 given)

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: python-gi 3.2.2-1~precise
ProcVersionSignature: Ubuntu 3.2.0-37.58-generic 3.2.35
Uname: Linux 3.2.0-37-generic i686
ApportVersion: 2.0.1-0ubuntu17.1
Architecture: i386
Date: Sun Feb 3 10:48:09 2013
InstallationMedia: Xubuntu 12.04.1 LTS "Precise Pangolin" - Release i386 (20120817.3)
MarkForUpload: True
ProcEnviron:
 TERM=xterm
 PATH=(custom, no user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: pygobject
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Sean Davis (bluesabre) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in pygobject (Ubuntu):
status: New → Confirmed
Revision history for this message
Liviu Andronic (landronimirc) wrote :

Concerning catfish, here it fails to run with the following message:
liv@malou-laptop:~$ catfish
python: can't open file 'bin/catfish.py': [Errno 2] No such file or directory

Would it help if I backported python-gi to work around this issue?

Revision history for this message
Martin Pitt (pitti) wrote :

This has been fixed upstream in 3.3.90, thus is fixed in Ubuntu Quantal and Raring.

Changed in pygobject (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
Sean Davis (bluesabre) wrote :

Hi Martin, is it possible to make a patch available in precise? Surely this is not the only python-gtk3 application that uses a sortable treeview.

Revision history for this message
Martin Pitt (pitti) wrote :

Do we have any package in Ubuntu 12.04 which is broken by this? For application developers there is always the better way of calling Gtk.TreeModelSort(model=your_model) or Gtk.TreeModelSort.new_with_model(your_model), both of which are the official API. The new override in Quantal is merely a workaround to provide backwards compatibility to the old pygtk, but is not the API as offered by introspection or GTK.

Changed in pygobject (Ubuntu):
importance: Undecided → Low
Revision history for this message
Sean Davis (bluesabre) wrote :

Oh, I somehow missed that. Yes, that does indeed work in precise as well. Thanks for your help Martin!

Changed in pygobject:
importance: Unknown → Medium
status: Unknown → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.