software-center crashed with ValueError in _parse_localename()

Bug #630248 reported by arjun on 2010-09-04
62
This bug affects 7 people
Affects Status Importance Assigned to Milestone
software-center (Ubuntu)
Medium
Michael Vogt
Maverick
Medium
Gary Lasker

Bug Description

Binary package hint: software-center

TEST CASE:
1. use maverick
2. set locale to something that the system does not know
3. verify that it crashes
4. install the version from maverick-proposed
5. verify that it works now

i am unable to open ubuntu software center (2.1.14.1) in maverick when malayalam language is selected. iam getting the following error in the terminal

Traceback (most recent call last):
  File "/usr/bin/software-center", line 86, in <module>
    app = SoftwareCenterApp(datadir, xapian_base_path, options, args)
  File "/usr/share/software-center/softwarecenter/app.py", line 141, in __init__
    self.history = get_apt_history()
  File "/usr/share/software-center/softwarecenter/apt/apthistory.py", line 167, in get_apt_history
    apt_history = AptHistory()
  File "/usr/share/software-center/softwarecenter/apt/apthistory.py", line 76, in __init__
    self.rescan()
  File "/usr/share/software-center/softwarecenter/apt/apthistory.py", line 88, in rescan
    self._scan(self.history_file)
  File "/usr/share/software-center/softwarecenter/apt/apthistory.py", line 105, in _scan
    trans = Transaction(stanza)
  File "/usr/share/software-center/softwarecenter/apt/apthistory.py", line 53, in __init__
    "%Y-%m-%d %H:%M:%S")
  File "/usr/lib/python2.6/_strptime.py", line 270, in <module>
    _TimeRE_cache = TimeRE()
  File "/usr/lib/python2.6/_strptime.py", line 188, in __init__
    self.locale_time = LocaleTime()
  File "/usr/lib/python2.6/_strptime.py", line 70, in __init__
    self.lang = _getlang()
  File "/usr/lib/python2.6/_strptime.py", line 29, in _getlang
    return locale.getlocale(locale.LC_TIME)
  File "/usr/lib/python2.6/locale.py", line 497, in getlocale
    return _parse_localename(localename)
  File "/usr/lib/python2.6/locale.py", line 410, in _parse_localename
    raise ValueError, 'unknown locale: %s' % localename
ValueError: unknown locale: ml_IN

ProblemType: Crash
DistroRelease: Ubuntu 10.10
Package: software-center 2.1.14.1
ProcVersionSignature: Ubuntu 2.6.35-19.28-generic 2.6.35.3
Uname: Linux 2.6.35-19-generic x86_64
Architecture: amd64
Date: Sat Sep 4 14:45:21 2010
ExecutablePath: /usr/share/software-center/software-center
InterpreterPath: /usr/bin/python2.6
LiveMediaBuild: Ubuntu 10.10 "Maverick Meerkat" - Beta amd64 (20100901.1)
PackageArchitecture: all
ProcCmdline: /usr/bin/python /usr/bin/software-center
ProcEnviron:
 LANG=ml_IN
 SHELL=/bin/bash
PythonArgs: ['/usr/bin/software-center']
SourcePackage: software-center
Title: software-center crashed with ValueError in _parse_localename()
UserGroups: adm admin cdrom dialout lpadmin plugdev sambashare

arjun (arjunak01) wrote :
tags: removed: need-duplicate-check
Kiwinote (kiwinote) on 2010-12-01
visibility: private → public
Matthew Paul Thomas (mpt) wrote :

Fixed in trunk r1342.

Changed in software-center (Ubuntu):
assignee: nobody → Michael Vogt (mvo)
importance: Undecided → Medium
status: New → Fix Committed
assignee: Michael Vogt (mvo) → nobody
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package software-center - 3.1.5

---------------
software-center (3.1.5) natty; urgency=low

  * softwarecenter/app.py:
    - on a invalid locale, reset the locale to "C" to avoid
      later crashes in the apthistory that uses strptime
      (lp: #630248)
  * softwarecenter/view/appview.py:
    - fix crash with the latest python-xapian (LP: #687399)
 -- Michael Vogt <email address hidden> Wed, 08 Dec 2010 18:05:05 +0100

Changed in software-center (Ubuntu):
status: Fix Committed → Fix Released
Gary Lasker (gary-lasker) wrote :

Nominated for Maverick due to the multiple reports of folks encountering this problem when updating to Maverick (see dupes) and for the fact that Software Center will not start at all when this occurs.

I've cherrypicked mvo's fix from natty in the attached branch lp:~gary-lasker/software-center/lp630248-fix-for-3.0 .

Thanks!

Michael Vogt (mvo) on 2011-02-10
Changed in software-center (Ubuntu Maverick):
status: New → In Progress
description: updated
Changed in software-center (Ubuntu Maverick):
importance: Undecided → Medium

Accepted software-center into maverick-proposed, the package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

Changed in software-center (Ubuntu Maverick):
status: In Progress → Fix Committed
tags: added: verification-needed
Gary Lasker (gary-lasker) wrote :

I am not able to reproduce this crash with software-center 3.0.7 and current maverick updates (steps 1-3 in the description). I set the locale to Malayalam per the original bug description by setting /etc/default/locale to be LANG="ml" and restarting. With this setting, Software Center version 3.0.7 starts normally with no crash.

Seems maybe I am not setting the locale correctly? Any advice is appreciated. I'd like to verify this bug so this update can make its way out of -proposed.

Thanks!

Changed in software-center (Ubuntu):
assignee: nobody → Michael Vogt (mvo)
Changed in software-center (Ubuntu Maverick):
assignee: nobody → Gary Lasker (gary-lasker)
milestone: none → maverick-updates
Jean-Baptiste Lallement (jibel) wrote :

I'm not able to reproduce this crash. I've tried with software-center and directly in python but I can't reproduce the datetime parse error.

The only error I get while playing with locales is the following but sc doesn't crashes:
Traceback (most recent call last):
  File "/usr/share/software-center/update-software-center-agent", line 76, in <module>
    if not update_from_software_center_agent(db, cache):
  File "/usr/share/software-center/softwarecenter/db/update.py", line 376, in update_from_software_center_agent
    sca.query_available()
  File "/usr/share/software-center/softwarecenter/backend/restfulclient.py", line 383, in query_available
    lang = get_default_language()
  File "/usr/share/software-center/softwarecenter/utils.py", line 189, in get_default_language
    locale = locale.getdefaultlocale()
  File "/usr/lib/python2.6/locale.py", line 478, in getdefaultlocale
    return _parse_localename(localename)
  File "/usr/lib/python2.6/locale.py", line 410, in _parse_localename
    raise ValueError, 'unknown locale: %s' % localename
ValueError: unknown locale: ml_IN

So, either, this is fixed in some way in S-C 3.0.7 (the report was filed against a pre-release version of S-C 2.X.X) or there is some specific ways to setup the locale that are missing in the test case.

Gary Lasker (gary-lasker) wrote :

Ok, so it's possible that we just don't have a reliable way to reproduce the original error. However, I was able to verify that this fix, which is quite clean and specific to this bug, doesn't produce any regression that I can find. I also verified that the version in -proposed starts normally when setting the locale to "ml" per the description.

In addition, this fix is a simple backport from an early-ish version of Software Center in Natty, and by this point in the cycle that has seen a good amount of testing by a good number users. As far as I can tell, there have been no known recurrences of this bug in Natty since the fix was released.

For these reasons, I'd like to recommend that we move Software Center 3.0.8 out of -proposed and release it into the general archives. In consideration of this, I will set the tag to verification-done.

Of course, please let me know if anyone doesn't agree.

Thanks!
Gary

tags: added: verification-done
removed: verification-needed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package software-center - 3.0.8

---------------
software-center (3.0.8) maverick-proposed; urgency=low

  [ Gary Lasker ]
  * softwarecenter/utils.py,
    softwarecenter/view/appdetailsview_gtk.py:
    - disable find-it-in-the-menu under Unity (LP: #639701)

  [ Michael Vogt ]
  * softwarecenter/app.py:
    - on a invalid locale, reset the locale to "C" to avoid
      later crashes in the apthistory that uses strptime
      (lp: #630248)
 -- Michael Vogt <email address hidden> Thu, 10 Feb 2011 09:16:49 +0100

Changed in software-center (Ubuntu Maverick):
status: Fix Committed → Fix Released
tags: added: testcase
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers