ccsm crashes with "locale.Error: unsupported locale setting" when locale is unsupported - should fallback to C

Bug #796308 reported by Sam_ on 2011-06-12
This bug affects 3 people
Affects Status Importance Assigned to Milestone
compizconfig-settings-manager (Ubuntu)

Bug Description

1. open a terminal
2. run the command:
   $ export LC_MESSAGES=unknown
3. ccsm

The crash below. ccsm should catch the exception and fallback to C.

$ ccsm
(process:1732): Gtk-WARNING **: Locale not supported by C library.
 Using the fallback 'C' locale.
Traceback (most recent call last):
  File "/usr/bin/ccsm", line 93, in <module>
    import ccm
  File "/usr/lib/python2.7/dist-packages/ccm/", line 1, in <module>
    from ccm.Conflicts import *
  File "/usr/lib/python2.7/dist-packages/ccm/", line 26, in <module>
    from ccm.Constants import *
  File "/usr/lib/python2.7/dist-packages/ccm/", line 79, in <module>
    locale.setlocale(locale.LC_ALL, "")
  File "/usr/lib/python2.7/", line 531, in setlocale
    return _setlocale(category, locale)
locale.Error: unsupported locale setting
When started with LANG=C it opens fine.

ProblemType: Bug
DistroRelease: Ubuntu 11.10
Package: compizconfig-settings-manager 0.9.4-0ubuntu3
ProcVersionSignature: Ubuntu 2.6.39-3.10-generic 2.6.39
Uname: Linux 2.6.39-3-generic x86_64
NonfreeKernelModules: wl
Architecture: amd64
Date: Sun Jun 12 20:58:30 2011
EcryptfsInUse: Yes
InstallationMedia: Ubuntu 11.04 "Natty Narwhal" - Release amd64 (20110423)
PackageArchitecture: all
 PATH=(custom, no user)
SourcePackage: compizconfig-settings-manager
UpgradeStatus: No upgrade log present (probably fresh install)

Sam_ (and-sam) wrote :
Jean-Baptiste Lallement (jibel) wrote :

Thanks for your report. This is easily reproducible. I'm setting to triaged/low because the workaround is easy, and usually the locale is set to a supported and installed locale.

summary: - [Oneiric] CCSM launcher doesn't start. Missing language support
+ ccsm crashes with "locale.Error: unsupported locale setting" when locale
+ is unsupported - should fallback to C
Changed in compizconfig-settings-manager (Ubuntu):
status: New → Triaged
importance: Undecided → Low
description: updated
Sam_ (and-sam) wrote :

dpkg-reconfigure locales was issued.
Maybe this Bug #198758 is similar.
$ locale
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Kann LC_ALL nicht auf die Standard-Lokale einstellen: Datei oder Verzeichnis nicht gefunden
## above line says: can't set LC_ALL to standard local: file or directory not found.

Sam_ (and-sam) wrote :

Since latest updates of language packages no further crash, CCSM starts from launcher without complains.

Jean-Baptiste Lallement (jibel) wrote :

This is because lightdm has been fixed to correctly handle locales but the crash still exists in ccsm if the locale isn't installed on the system (see test case)

Ubuntu Bug Squad volunteer triager

description: updated
Sam_ (and-sam) wrote :

Thanks for the clarification; I thought because locales was updated also.
locales 2.13+git20110617-1

tags: added: testcase
w-sky (w-sky) wrote :

This bug affects me now with Ubuntu 12.04 beta when the "Regional Formats" have been changed with the Language Support tool to something else than "en_US.UTF-8" !!!

Workaround: in a terminal, enter the following command:
export LC_ALL="en_US.UTF-8"

then start ccsm in that terminal.

w-sky (w-sky) wrote :

PS: same problem with OpenShot ... it will not start and complain about languages unless preceded by
export LC_ALL="en_US.UTF-8"
in a terminal.

locale-gen does not help.

Phillip Susi (psusi) wrote :

This package has been removed from Ubuntu. Closing all related bugs.

Changed in compizconfig-settings-manager (Ubuntu):
status: Triaged → Invalid
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers