← Back to team overview

tieto team mailing list archive

[Bug 947812] Re: Software Center crash of there is a # comment in /etc/apt/preferences.d/testing

 

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

** Changed in: software-center (Ubuntu)
       Status: New => Confirmed

-- 
You received this bug notification because you are a member of Tieto,
which is subscribed to the bug report.
https://bugs.launchpad.net/bugs/947812

Title:
  Software Center crash of there is a # comment in
  /etc/apt/preferences.d/testing

Status in “software-center” package in Ubuntu:
  Confirmed

Bug description:
  If I create the file /etc/apt/preferences.d/testing with "# aaa" in it
  Software Center will crash when I start it on Ubuntu 12.04 beta 1.

  I am not 100% sure if # comments are allowed in these files but
  Software Center should not crash like this even if I have added some
  illegal chars in a config file.

  As long as I do not add any # comments I can use the
  /etc/apt/preferences.d/testing file but # comments are useful...

  apt-get have no problems with these comments.

  This is the output from software-center:
  2012-03-06 08:45:48,791 - softwarecenter.backend.reviews - WARNING - Could not get usefulness from server, no username in config file
  Traceback (most recent call last):
    File "/usr/share/software-center/softwarecenter/db/pkginfo_impl/aptcache.py", line 222, in open
      self._cache = apt.Cache(GtkMainIterationProgress())
    File "/usr/lib/python2.7/dist-packages/apt/cache.py", line 102, in __init__
      self.open(progress)
    File "/usr/lib/python2.7/dist-packages/apt/cache.py", line 145, in open
      self._cache = apt_pkg.Cache(progress)
  SystemError: E:Unable to parse package file /etc/apt/preferences.d/testing (1)
  2012-03-06 08:45:50,708 - softwarecenter.db.enquire - ERROR - _get_estimate_nr_apps_and_nr_pkgs failed
  Traceback (most recent call last):
    File "/usr/share/software-center/softwarecenter/db/enquire.py", line 115, in _get_estimate_nr_apps_and_nr_pkgs
      tmp_matches = enquire.get_mset(0, len(self.db), None, xfilter)
    File "/usr/share/software-center/softwarecenter/db/appfilter.py", line 74, in __call__
      if (not pkgname in self.cache and
    File "/usr/share/software-center/softwarecenter/db/pkginfo_impl/aptcache.py", line 241, in __contains__
      return self._cache.__contains__(k)
  AttributeError: 'NoneType' object has no attribute '__contains__'
  Traceback (most recent call last):
    File "/usr/bin/software-center", line 176, in <module>
      app.run(args)
    File "/usr/share/software-center/softwarecenter/ui/gtk3/app.py", line 1279, in run
      self.show_available_packages(args)
    File "/usr/share/software-center/softwarecenter/ui/gtk3/app.py", line 1208, in show_available_packages
      self.view_manager.set_active_view(ViewPages.AVAILABLE)
    File "/usr/share/software-center/softwarecenter/ui/gtk3/session/viewmanager.py", line 148, in set_active_view
      view_widget.init_view()
    File "/usr/share/software-center/softwarecenter/ui/gtk3/panes/availablepane.py", line 157, in init_view
      self.apps_filter)
    File "/usr/share/software-center/softwarecenter/ui/gtk3/views/catview_gtk.py", line 234, in __init__
      self.build(desktopdir)
    File "/usr/share/software-center/softwarecenter/ui/gtk3/views/catview_gtk.py", line 476, in build
      self._build_homepage_view()
    File "/usr/share/software-center/softwarecenter/ui/gtk3/views/catview_gtk.py", line 253, in _build_homepage_view
      self._append_whats_new()
    File "/usr/share/software-center/softwarecenter/ui/gtk3/views/catview_gtk.py", line 415, in _append_whats_new
      whats_new_cat = self._update_whats_new_content()
    File "/usr/share/software-center/softwarecenter/ui/gtk3/views/catview_gtk.py", line 404, in _update_whats_new_content
      docs = whats_new_cat.get_documents(self.db)
    File "/usr/share/software-center/softwarecenter/db/categories.py", line 120, in get_documents
      nonblocking_load=False)
    File "/usr/share/software-center/softwarecenter/db/enquire.py", line 316, in set_query
      self._blocking_perform_search()
    File "/usr/share/software-center/softwarecenter/db/enquire.py", line 211, in _blocking_perform_search
      matches = enquire.get_mset(0, self.limit, None, xfilter)
    File "/usr/share/software-center/softwarecenter/db/appfilter.py", line 74, in __call__
      if (not pkgname in self.cache and 
    File "/usr/share/software-center/softwarecenter/db/pkginfo_impl/aptcache.py", line 241, in __contains__
      return self._cache.__contains__(k)
  AttributeError: 'NoneType' object has no attribute '__contains__'

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/software-center/+bug/947812/+subscriptions