software-properties-gtk crashed with AttributeError in remove_source(): 'NoneType' object has no attribute 'file'

Bug #820150 reported by otto888
298
This bug affects 57 people
Affects Status Importance Assigned to Milestone
software-properties (Ubuntu)
Fix Released
Medium
Martin Pitt

Bug Description

I was trying to remove a repository.

ProblemType: Crash
DistroRelease: Ubuntu 11.10
Package: software-properties-gtk 0.81.4
ProcVersionSignature: Ubuntu 3.0.0-7.9-generic 3.0.0
Uname: Linux 3.0.0-7-generic x86_64
Architecture: amd64
Date: Tue Aug 2 21:08:28 2011
ExecutablePath: /usr/bin/software-properties-gtk
InstallationMedia: Ubuntu 11.10 "Oneiric Ocelot" - Alpha amd64 (20110705.1)
InterpreterPath: /usr/bin/python2.7
PackageArchitecture: all
ProcCmdline: /usr/bin/python /usr/bin/software-properties-gtk -n -t 62914689
ProcEnviron:
 PATH=(custom, no user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
PythonArgs: ['/usr/bin/software-properties-gtk', '-n', '-t', '62914689']
SourcePackage: software-properties
Title: software-properties-gtk crashed with AttributeError in remove_source(): 'NoneType' object has no attribute 'file'
UpgradeStatus: Upgraded to oneiric on 2011-08-03 (0 days ago)
UserGroups:

Revision history for this message
otto888 (otto888) wrote :
tags: removed: need-duplicate-check
Changed in software-properties (Ubuntu):
status: New → Confirmed
tags: added: bugpattern-needed
Changed in software-properties (Ubuntu):
importance: Undecided → Medium
status: Confirmed → Triaged
visibility: private → public
tags: removed: bugpattern-needed
tags: added: bugpattern-written
Revision history for this message
Samuel Dorsaz (akira86) wrote :

I don't have bug trace now, but I simply add this repository at first with this command :
sudo add-apt-repository ppa:team-xbmc/unstable

And crash appear when you use ubuntu software center and source manager application to remove this respository. The other way to remove it is to remove file in /etc/apt/source.list.d/

Revision history for this message
Gunnar Wegner (gunnar-wegner) wrote :

I confirm what Samuel says.

I (accidentially) wanted to remove a repository while, in a terminal, i had "sudo apt-get update" running, and the source manager crashed.

Revision history for this message
Richard Ayotte (rich-ayotte) wrote :

Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/softwareproperties/gtk/SoftwarePropertiesGtk.py", line 839, in on_remove_clicked
    self.backend.RemoveSource(str(source_entry))
  File "/usr/lib/python2.7/dist-packages/dbus/proxies.py", line 143, in __call__
    **keywords)
  File "/usr/lib/python2.7/dist-packages/dbus/connection.py", line 630, in call_blocking
    message, timeout)
dbus.exceptions.DBusException: org.freedesktop.DBus.Python.AttributeError: Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/dbus/service.py", line 702, in _message_cb
    retval = candidate_method(self, *args, **keywords)
  File "/usr/lib/python2.7/dist-packages/softwareproperties/dbus/SoftwarePropertiesDBus.py", line 269, in RemoveSource
    self.remove_source(source.encode("utf-8"))
  File "/usr/lib/python2.7/dist-packages/softwareproperties/SoftwareProperties.py", line 711, in remove_source
    if source.file != apt_pkg.config.find_file("Dir::Etc::sourcelist"):
AttributeError: 'NoneType' object has no attribute 'file'

Martin Pitt (pitti)
Changed in software-properties (Ubuntu):
status: Triaged → Fix Committed
assignee: nobody → Martin Pitt (pitti)
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package software-properties - 0.82.5

---------------
software-properties (0.82.5) precise; urgency=low

  * softwareproperties/gtk/SoftwarePropertiesGtk.py: Drop duplicate definition
    of on_treeview_sources_cursor_changed().
  * softwareproperties/gtk/SoftwarePropertiesGtk.py: Fix crash when closing
    the application with the window title bar button. (LP: #911834)
  * add-apt-repository: Intercept ValueError in addition to URLError, as this
    is the error thrown when trying to decode invalid JSON (which happens on
    404 pages etc.). (LP: #861258)
  * softwareproperties/SoftwareProperties.py, _find_source_from_string():
    Reload the sources list before searching, as it might have changed while
    the D-BUS backend was running. (LP: #854818, #820150)
  * softwareproperties/gtk/SoftwarePropertiesGtk.py: Add missing argument to
    menu popup() call. (LP: #815236)
 -- Martin Pitt <email address hidden> Wed, 07 Mar 2012 10:14:52 +0100

Changed in software-properties (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
JG (jdogzz-g5) wrote :

I just got this error on a fully upgraded system so this bug hasn't been fixed yet.

Revision history for this message
Sasa Paporovic (melchiaros) wrote :

I am too.

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.