Ubuntu

Widget names not set when using GtkBuilder

Reported by Severin Heiniger on 2010-01-15
164
This bug affects 10 people
Affects Status Importance Assigned to Milestone
GTK+
Fix Released
Medium
Gramps
Fix Released
Unknown
LottaNZB
Critical
Severin Heiniger
Luciole
Critical
NicoInattendu
gramps (Ubuntu)
Undecided
Unassigned
Lucid
Undecided
Unassigned
Maverick
Undecided
Unassigned
gtk+2.0 (Ubuntu)
Low
Unassigned
Lucid
Low
Unassigned
Maverick
Low
Unassigned
lottanzb (Ubuntu)
Medium
Severin Heiniger
Lucid
Medium
Severin Heiniger
Maverick
Medium
Severin Heiniger
pygtk (Ubuntu)
Low
Unassigned
Lucid
Low
Unassigned
Maverick
Low
Unassigned

Bug Description

LottaNZB cannot be launched on an up-to-date Lucid machine because of a bug in GtkBuilder. I tracked down the problem:

When loading a XML UI file using GtkBuilder, the 'name' property of widgets isn't set. On the other hand, the 'name' property of 'GtkAction' objects is properly set.

A test case written in both Python and C is attached. Compare the output on a Karmic and a Lucid machine.

I'm pretty sure that LottaNZB worked about a week ago, when I initially installed Lucid. This means that the bug could have been introduced in a recent update.

ProblemType: Crash
Architecture: i386
Date: Fri Jan 15 01:44:44 2010
DistroRelease: Ubuntu 10.04
ExecutablePath: /usr/bin/lottanzb
InstallationMedia: Ubuntu 10.04 "Lucid Lynx" - Alpha i386 (20091209)
InterpreterPath: /usr/bin/python2.6
Package: lottanzb 0.5.2-1
PackageArchitecture: all
ProcCmdline: /usr/bin/python /usr/bin/lottanzb
ProcEnviron:
 LANG=de_CH.UTF-8
 SHELL=/bin/bash
ProcVersionSignature: Ubuntu 2.6.32-9.13-generic
PythonArgs: ['/usr/bin/lottanzb']
RelatedPackageVersions:
 lottanzb 0.5.2-1
 hellanzb 0.13-5.4
SourcePackage: lottanzb
Tags: lucid
Title: lottanzb crashed with AttributeError in _autoconnect_by_method_name()
Uname: Linux 2.6.32-9-generic i686
UserGroups: adm admin cdrom dialout lpadmin plugdev sambashare

Related branches

Severin Heiniger (severinh) wrote :
visibility: private → public
summary: - lottanzb crashed with AttributeError in _autoconnect_by_method_name()
+ Widget names not set when using gtk.Builder

Execute this file using "python testcase.py".

description: updated
Severin Heiniger (severinh) wrote :

The UI file.

Severin Heiniger (severinh) wrote :

I'd be glad if someone confirmed the bug so that it could be forwarded upstream.

Severin Heiniger (severinh) wrote :

I just ported the Python testcase to raw C code. The bug can also be reproduced here. Everything is fine in Karmic, but in Lucid, the widget names are not set.

This means that it's not actually a bug in PyGTK, but GTK itself.

Severin Heiniger (severinh) wrote :

C test-case. Compile it using

gcc testcase.c -Wall -o testcase `pkg-config --cflags --libs gtk+-2.0`

and make sure that 'testcase.ui' is in the same directory as 'testcase' when executing it.

description: updated
summary: - Widget names not set when using gtk.Builder
+ Widget names not set when using GtkBuilder
description: updated
Changed in lottanzb:
status: New → Invalid
Changed in lottanzb (Ubuntu):
status: New → Invalid
Severin Heiniger (severinh) wrote :

The bug has been reported upstream.

Changed in gtk+2.0 (Ubuntu):
status: New → Invalid
Changed in pygtk (Ubuntu):
status: New → Invalid
Severin Heiniger (severinh) wrote :

The bug has been marked as a duplicate upstream. The problem is that the "name" property is only meant to be used w.r.t. themes and doesn't need to be unique. The GtkBuilder ID however needs to be unique and was bound to the "name" property until now.

This means that the problem can be fixed within LottaNZB using a rather ugly hack by getting the GtkBuilder ID using gtk.Buildable.get_name(widget). Let's hope that the GTK/PyGTK API's will be updated regarding this issue by adding methods/functions like "get_id" or "get_buildable_id".

Changed in lottanzb:
status: Invalid → Triaged
status: Triaged → In Progress
assignee: nobody → Severin Heiniger (lantash)
importance: Undecided → Critical
milestone: none → 0.5.3
Changed in lottanzb:
status: In Progress → Fix Committed
Changed in lottanzb (Ubuntu):
status: Invalid → Won't Fix
status: Won't Fix → Triaged
importance: Undecided → Medium
assignee: nobody → Severin Heiniger (lantash)
Martin Pitt (pitti) on 2010-02-05
description: updated
tags: removed: need-duplicate-check
Changed in lottanzb:
status: Fix Committed → Fix Released
Changed in lottanzb (Ubuntu):
status: Triaged → Fix Released
Benny (benny-malengier) wrote :

Added link to Gramps bug ticket.
The Gramps application crashes in parts using gtk.Builder due to this issue.
How will this be resolved? Should applications update or will there be a patch against gtk/pygtk so that applications start working again?

Benny (benny-malengier) wrote :

Looking at
https://bugzilla.gnome.org/show_bug.cgi?id=591085
the change seems to be intentional, so Ubuntu should patch applications hit by it in 10.04

Changed in gramps:
status: Unknown → New
Changed in gramps:
status: New → Fix Released
Martin Pitt (pitti) wrote :

Fixed in maverick.

Changed in gramps (Ubuntu Maverick):
status: New → Fix Released
Sebastien Bacher (seb128) wrote :

tghe issue is not a bug in gtk

Changed in gtk+2.0 (Ubuntu Lucid):
importance: Undecided → Low
status: New → Invalid
Changed in gtk+2.0 (Ubuntu Maverick):
importance: Undecided → Low
Changed in pygtk (Ubuntu Maverick):
importance: Undecided → Low
Sebastien Bacher (seb128) wrote :

the issue is not a pygtk one either

Changed in pygtk (Ubuntu Lucid):
importance: Undecided → Low
status: New → Invalid
Changed in lottanzb (Ubuntu Lucid):
assignee: nobody → Severin Heiniger (lantash)
importance: Undecided → Medium
status: New → Fix Released
NicoInattendu (nico-inattendu) wrote :

Affects also luciole version 0.9 only.
A dictionary of objects was used to get the widget from gtk.builder.
Modify luciole 0.9 to use gtk.builder.get_objet() instead.

Changed in luciole:
assignee: nobody → NicoInattendu (nico-inattendu)
importance: Undecided → Medium
milestone: none → 0.9.2
NicoInattendu (nico-inattendu) wrote :

Fix commited with solution used in gramps.
Replace of :
obj.get_name() :
by
gtk.Buildable.get_name(obj)

Changed in luciole:
importance: Medium → Critical
status: New → Fix Committed
Changed in gtk:
importance: Unknown → Medium
status: Unknown → Fix Released
Changed in luciole:
milestone: 0.9.2 → 0.9.3
Changed in luciole:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

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