[UIFe] TypeError when opening edit menu

Bug #1151621 reported by Sundaravenkataraman
236
This bug affects 55 people
Affects Status Importance Assigned to Milestone
Ubuntu Software Center
Status tracked in Trunk
Stable-5-6
Triaged
Medium
Unassigned
Trunk
Fix Released
High
dobey
gtk+3.0 (Ubuntu)
Confirmed
Undecided
Unassigned
software-center (Ubuntu)
Fix Released
High
dobey

Bug Description

The following trace occurs when opening the "Edit" menu in software-center, as a result of an incompatible change in one of GTK+, pygobject, or libgirepository. The code in software-center is correct, but the bindings are causing the wrong method to be called, resulting in the trace.

Traceback (most recent call last):
  File "/usr/share/software-center/softwarecenter/ui/gtk3/app.py", line 967, in on_menu_edit_activate
    bounds = self.active_pane.searchentry.get_selection_bounds()
  File "/usr/lib/python2.7/dist-packages/gi/overrides/__init__.py", line 99, in wrapped
    ret = method(*args, **kwargs)
TypeError: unbound method get_selection_bounds() must be called with TextBuffer instance as first argument (got SearchEntry instance instead)

As a work around for this, I have removed the code in software-center, which makes the Cut/Copy items in the Edit menu no longer apply to the search entry. As a result, this also removes the Cut item completely, as it was only used for the search entry. However, it is still possible to use the context-menu when right clicking on the entry, or the standard C-x/C-c key bindings, to cut or copy the selected text in the entry.

Mailing list request messages:
Docs: https://lists.ubuntu.com/archives/ubuntu-doc/2013-April/017165.html
I18n: https://lists.ubuntu.com/archives/ubuntu-translators/2013-April/005867.html

Related branches

Revision history for this message
Sundaravenkataraman (ssvr-nyl) wrote :
tags: removed: need-duplicate-check
Changed in software-center (Ubuntu):
importance: Undecided → Medium
information type: Private → Public
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in software-center (Ubuntu):
status: New → Confirmed
Revision history for this message
Sebastien Bacher (seb128) wrote :

Thank you for your bug report

Rodney, could you look at it? It got 239 reports this month

Changed in software-center (Ubuntu):
assignee: nobody → Rodney Dawes (dobey)
importance: Medium → High
Revision history for this message
Ubuntu QA Website (ubuntuqa) wrote :

This bug has been reported on the Ubuntu Package testing tracker.

A list of all reports related to this bug can be found here:
http://packages.qa.ubuntu.com/qatracker/reports/bugs/1151621

tags: added: package-qa-testing
Revision history for this message
Robert Avant (robertj-avant) wrote :
Download full text (3.3 KiB)

I too have this bug. I also have a problem with this:

Correcting dependencies... Done
The following extra packages will be installed:
  language-pack-en language-pack-en-base
The following packages will be upgraded:
  language-pack-en language-pack-en-base
2 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.
1 not fully installed or removed.
Need to get 0 B/868 kB of archives.
After this operation, 289 kB of additional disk space will be used.
Do you want to continue [Y/n]? y
  language-pack-en-base:amd64 conflicts with language-pack-en:amd64
(Reading database ... 623880 files and directories currently installed.)
Preparing to replace language-pack-en 1:12.10+20121009 (using .../language-pack-en_1%3a13.04+20130326_all.deb) ...
Unpacking replacement language-pack-en ...
Replacing files in old package language-pack-en-base ...
Preparing to replace language-pack-en-base 1:12.10+20121009 (using .../language-pack-en-base_1%3a13.04+20130321_all.deb) ...
Unpacking replacement language-pack-en-base ...
Replaced by files in installed package language-pack-en ...
Processing triggers for software-center ...
Updating software catalog...this may take a moment.
INFO:softwarecenter.db.pkginfo_impl.aptcache:aptcache.open()
WARNING:softwarecenter.db.update:The file: '/usr/share/app-install/desktop/sonic-visualiser:x-sonicvisualiser-layer.desktop' could not be read correctly. The application associated with this file will not be included in the software catalog. Please consider raising a bug report for this issue with the maintainer of that application
WARNING:softwarecenter.db.update:The file: '/usr/share/app-install/desktop/gmpc:gmpc.desktop' could not be read correctly. The application associated with this file will not be included in the software catalog. Please consider raising a bug report for this issue with the maintainer of that application
WARNING:softwarecenter.db.update:The file: '/usr/share/app-install/desktop/workrave:workrave.desktop' could not be read correctly. The application associated with this file will not be included in the software catalog. Please consider raising a bug report for this issue with the maintainer of that application
WARNING:softwarecenter.db.update:The file: '/usr/share/app-install/desktop/sonic-visualiser:x-sonicvisualiser.desktop' could not be read correctly. The application associated with this file will not be included in the software catalog. Please consider raising a bug report for this issue with the maintainer of that application
Software catalog update was successful.
Setting up language-pack-en (1:13.04+20130326) ...
Setting up language-pack-en-base (1:13.04+20130321) ...
Generating locales...
  en_AG.UTF-8... up-to-date
  en_AU.UTF-8... up-to-date
  en_BW.UTF-8... up-to-date
  en_CA.UTF-8... up-to-date
  en_DK.UTF-8... up-to-date
  en_GB.UTF-8... up-to-date
  en_HK.UTF-8... up-to-date
  en_IE.UTF-8... up-to-date
  en_IN.UTF-8... up-to-date
  en_NG.UTF-8... up-to-date
  en_NZ.UTF-8... up-to-date
  en_PH.UTF-8... up-to-date
  en_SG.UTF-8... up-to-date
  en_US.UTF-8... up-to-date
  en_ZA.UTF-8... up-to-date
  en_ZM.UTF-8... up-to-date
  en_ZW.UTF-8... up-to-date
Generation complete.
Processing trigger...

Read more...

Revision history for this message
Frogs Hair (detaill) wrote :

Confirmed - Already reported

Revision history for this message
Harald Glatt (hachre) wrote :

For me this happened when I installed a program, then immediately decided that I don't want it and hit the Remove button that shows up (while it was still installing) it then removed the Remove button or grayed it out, not sure anymore - and after the progress bar on the item was gone the installer crashed and brought me here! Hope it helps tracking it down!

Revision history for this message
userDepth (binarydepth) wrote :

I was opening Software sources.

Revision history for this message
dobey (dobey) wrote :

I've added GTK+ 3.0 as being affected, as this is actually a bug in GTK+ itself, it seems. Or at least, if it's not in GTK+, then it's either pygobject or libgirepository not correctly binding the methods.

It seems that software-center is making a valid call to get_selection_bounds() on a GtkSearchEntry widget, which implements the GtkEditable interface, and provides a get_selection-bounds() method. However, for some reason, this is being seen as an unbound method when called here, and the gtk_text_buffer_get_selection_bounds() method is being called instead, incorrectly, causing the TypeError.

I will implement a workaround in software-center so that the TypeError gets ignored (as the code in software-center is correct here), which may cause the Cut and Copy menu items to no longer work for the search entry. However, the standard key bindings, and the right-click context menu on the entry, will still work to copy/cut the selected text. Also, the Cut menu item will be removed as it's not used elsewhere, while Copy is used for copying text from other parts of the UI.

dobey (dobey)
summary: - software-center crashed with TypeError in wrapped(): unbound method
- get_selection_bounds() must be called with TextBuffer instance as first
- argument (got SearchEntry instance instead)
+ [UIFe] TypeError when opening edit menu
dobey (dobey)
description: updated
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in gtk+3.0 (Ubuntu):
status: New → Confirmed
dobey (dobey)
description: updated
Revision history for this message
dobey (dobey) wrote :
Revision history for this message
Steve Langasek (vorlon) wrote :

UIFe granted.

Changed in software-center (Ubuntu):
status: Confirmed → Triaged
Julien Funk (jaboing)
tags: added: u1-by-user u1-on-production
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package software-center - 5.6.0-0ubuntu2

---------------
software-center (5.6.0-0ubuntu2) raring; urgency=low

  * debian/patches/00_bzr-typerror-remove-menuitem.patch:
    - Avoid TypeError caused by external bug, by removing the Cut
      menu item from the main menu, and making the Copy item not
      used for the search entry. (LP: #1151621)
 -- Rodney Dawes <email address hidden> Mon, 08 Apr 2013 15:04:00 -0400

Changed in software-center (Ubuntu):
status: Triaged → Fix Released
Dave Morley (davmor2)
Changed in gtk+3.0 (Ubuntu):
importance: Undecided → High
importance: High → Undecided
tags: added: patch
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.