Widget names not set when using GtkBuilder

Bug #507739 reported by Severin H
164
This bug affects 10 people
Affects Status Importance Assigned to Milestone
GTK+
Fix Released
Medium
Gramps
Fix Released
Unknown
LottaNZB
Fix Released
Critical
Severin H
Luciole
Fix Released
Critical
NicoInattendu
gramps (Ubuntu)
Fix Released
Undecided
Unassigned
Lucid
Won't Fix
Undecided
Unassigned
Maverick
Fix Released
Undecided
Unassigned
gtk+2.0 (Ubuntu)
Invalid
Low
Unassigned
Lucid
Invalid
Low
Unassigned
Maverick
Invalid
Low
Unassigned
lottanzb (Ubuntu)
Fix Released
Medium
Severin H
Lucid
Fix Released
Medium
Severin H
Maverick
Fix Released
Medium
Severin H
pygtk (Ubuntu)
Invalid
Low
Unassigned
Lucid
Invalid
Low
Unassigned
Maverick
Invalid
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

Revision history for this message
Severin H (severinh) wrote :
visibility: private → public
Severin H (severinh)
summary: - lottanzb crashed with AttributeError in _autoconnect_by_method_name()
+ Widget names not set when using gtk.Builder
Revision history for this message
Severin H (severinh) wrote : Re: Widget names not set when using gtk.Builder

Execute this file using "python testcase.py".

description: updated
Revision history for this message
Severin H (severinh) wrote :

The UI file.

Revision history for this message
Severin H (severinh) wrote :

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

Revision history for this message
Severin H (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.

Revision history for this message
Severin H (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
Severin H (severinh)
Changed in lottanzb:
status: New → Invalid
Changed in lottanzb (Ubuntu):
status: New → Invalid
Revision history for this message
Severin H (severinh) wrote :

The bug has been reported upstream.

Severin H (severinh)
Changed in gtk+2.0 (Ubuntu):
status: New → Invalid
Changed in pygtk (Ubuntu):
status: New → Invalid
Revision history for this message
Severin H (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
Severin H (severinh)
Changed in lottanzb:
status: In Progress → Fix Committed
Severin H (severinh)
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)
description: updated
tags: removed: need-duplicate-check
Severin H (severinh)
Changed in lottanzb:
status: Fix Committed → Fix Released
Severin H (severinh)
Changed in lottanzb (Ubuntu):
status: Triaged → Fix Released
Revision history for this message
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?

Revision history for this message
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
Revision history for this message
Martin Pitt (pitti) wrote :

Fixed in maverick.

Changed in gramps (Ubuntu Maverick):
status: New → Fix Released
Revision history for this message
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
Revision history for this message
Sebastien Bacher (seb128) wrote :

the issue is not a pygtk one either

Changed in pygtk (Ubuntu Lucid):
importance: Undecided → Low
status: New → Invalid
Severin H (severinh)
Changed in lottanzb (Ubuntu Lucid):
assignee: nobody → Severin Heiniger (lantash)
importance: Undecided → Medium
status: New → Fix Released
Revision history for this message
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
Revision history for this message
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
Revision history for this message
Rolf Leggewie (r0lf) wrote :

lucid has seen the end of its life and is no longer receiving any updates. Marking the lucid task for this ticket as "Won't Fix".

Changed in gramps (Ubuntu Lucid):
status: New → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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