locale.Error: unsupported locale setting

Bug #1029204 reported by Fred
820
This bug affects 129 people
Affects Status Importance Assigned to Milestone
One Hundred Papercuts
Fix Released
High
Unassigned
command-not-found
Fix Released
Undecided
Unassigned
command-not-found (Ubuntu)
Fix Released
High
Unassigned

Bug Description

bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
$ weston
Sorry, command-not-found has crashed! Please file a bug report at:
https://bugs.launchpad.net/command-not-found/+filebug
Please include the following information with the report:

command-not-found version: 0.3
Python version: 3.2.3 final 0
Distributor ID: Ubuntu
Description: Ubuntu quantal (development branch)
Release: 12.10
Codename: quantal
Exception information:

unsupported locale setting
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/CommandNotFound/util.py", line 24, in crash_guard
    callback()
  File "/usr/lib/command-not-found", line 69, in main
    enable_i18n()
  File "/usr/lib/command-not-found", line 40, in enable_i18n
    locale.setlocale(locale.LC_ALL, '')
  File "/usr/lib/python3.2/locale.py", line 541, in setlocale
    return _setlocale(category, locale)
locale.Error: unsupported locale setting

Revision history for this message
Rafael Rios Saavedra (rsaavedra-a) wrote :

This is exactly the same that happens to me:

rafa@rafa-desk:~$ alskdjfah
Sorry, command-not-found has crashed! Please file a bug report at:
https://bugs.launchpad.net/command-not-found/+filebug
Please include the following information with the report:

command-not-found version: 0.3
Python version: 3.2.3 final 0
Distributor ID: Ubuntu
Description: Ubuntu 12.10
Release: 12.10
Codename: quantal
Exception information:

unsupported locale setting
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/CommandNotFound/util.py", line 24, in crash_guard
    callback()
  File "/usr/lib/command-not-found", line 69, in main
    enable_i18n()
  File "/usr/lib/command-not-found", line 40, in enable_i18n
    locale.setlocale(locale.LC_ALL, '')
  File "/usr/lib/python3.2/locale.py", line 541, in setlocale
    return _setlocale(category, locale)
locale.Error: unsupported locale setting

The locales that are set:

rafa@rafa-desk:~$ locale
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=es_ES.UTF-8
LANGUAGE=es_ES
LC_CTYPE="es_ES.UTF-8"
LC_NUMERIC="es_ES.UTF-8"
LC_TIME="es_ES.UTF-8"
LC_COLLATE="es_ES.UTF-8"
LC_MONETARY="es_ES.UTF-8"
LC_MESSAGES="es_ES.UTF-8"
LC_PAPER="es_ES.UTF-8"
LC_NAME="es_ES.UTF-8"
LC_ADDRESS="es_ES.UTF-8"
LC_TELEPHONE="es_ES.UTF-8"
LC_MEASUREMENT="es_ES.UTF-8"
LC_IDENTIFICATION="es_ES.UTF-8"
LC_ALL=

Revision history for this message
Rafael Rios (rafael-rios-saavedra) wrote :

I have resolved this issue reinstalling the language packs, in my case:

# apt-get --reinstall install language-pack-es
# apt-get --reinstall install language-pack-kde-es

Revision history for this message
Carsten Kämmerer (ckxx) wrote :

command-not-found crashes every time, when it is called using an unknown or uninstalled locale.

So I try:

ck@cebulon:~$ LANG=asd asd
Sorry, command-not-found has crashed! Please file a bug report at:
https://bugs.launchpad.net/command-not-found/+filebug
Please include the following information with the report:

command-not-found version: 0.3
Python version: 3.2.3 final 0
Distributor ID: Ubuntu
Description: Ubuntu 12.10
Release: 12.10
Codename: quantal
Exception information:

unsupported locale setting
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/CommandNotFound/util.py", line 24, in crash_guard
    callback()
  File "/usr/lib/command-not-found", line 69, in main
    enable_i18n()
  File "/usr/lib/command-not-found", line 40, in enable_i18n
    locale.setlocale(locale.LC_ALL, '')
  File "/usr/lib/python3.2/locale.py", line 541, in setlocale
    return _setlocale(category, locale)
locale.Error: unsupported locale setting

This is on my Ubuntu 12.10.

But on my other computer with Ubuntu 12.04 it crashes as well (although with less output).

Is it an python problem?

Revision history for this message
Hans Joachim Desserud (hjd) wrote :

Indeed, like comment #3 describes, any uknown locale will trigger a crash.

Changed in command-not-found:
status: New → Confirmed
tags: added: quantal
Revision history for this message
Ferrari Lee (shiyung) wrote :

I have the same problemcommand-not-found version: 0.3
Python version: 3.2.3 final 0
Distributor ID: Ubuntu
Description: Ubuntu 12.10
Release: 12.10
Codename: quantal
Exception information:

unsupported locale setting
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/CommandNotFound/util.py", line 24, in crash_guard
    callback()
  File "/usr/lib/command-not-found", line 69, in main
    enable_i18n()
  File "/usr/lib/command-not-found", line 40, in enable_i18n
    locale.setlocale(locale.LC_ALL, '')
  File "/usr/lib/python3.2/locale.py", line 541, in setlocale
    return _setlocale(category, locale)
locale.Error: unsupported locale setting

And I tried to set LC_ALL and it works,
but I'm not sure is that a right way or not.

Revision history for this message
Hamed Abdy (hamed-abdy) wrote :

I have the same problem.
Output for locale is:

locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=en_US.UTF-8
LANGUAGE=
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME=en_US_custom.UTF-8
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

Revision history for this message
Hamed Abdy (hamed-abdy) wrote :

The problem has solved for me after removing the following line from "/etc/environment":

LC_TIME="en_US_custom.UTF-8"

Revision history for this message
Gvozdik Artem (gvozdik) wrote :

command-not-found version: 0.3
Python version: 3.2.3 final 0
Distributor ID: Ubuntu
Description: Ubuntu 12.10
Release: 12.10
Codename: quantal
Exception information:

unsupported locale setting
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/CommandNotFound/util.py", line 24, in crash_guard
    callback()
  File "/usr/lib/command-not-found", line 69, in main
    enable_i18n()
  File "/usr/lib/command-not-found", line 40, in enable_i18n
    locale.setlocale(locale.LC_ALL, '')
  File "/usr/lib/python3.2/locale.py", line 541, in setlocale
    return _setlocale(category, locale)
locale.Error: unsupported locale setting

Revision history for this message
Gvozdik Artem (gvozdik) wrote :

>The problem has solved for me after removing the following line from "/etc/environment":
>LC_TIME="en_US_custom.UTF-8"

Works for me, but a little different:
I`ve added this line in /etc/environment

LC_ALL="ru_RU.utf8"

Works well for me.

Revision history for this message
Marcin Janowski (janowski-m) wrote :

Po tej operacji zostanie zwolnione 1365 MB miejsca na dysku.
Kontynuować [T/n]? n
Przerwane.
root@wmp-Aspire-3830TG:/home/wmp# LANG=en_GB apt-get install pulseaudio:i386
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 pulseaudio:i386 : Depends: consolekit:i386 but it is not going to be installed
                   Depends: libasound2-plugins:i386 but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
root@wmp-Aspire-3830TG:/home/wmp# LANG=en_GB
root@wmp-Aspire-3830TG:/home/wmp# apt-get install pulseaudio:i386
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 pulseaudio:i386 : Depends: consolekit:i386 but it is not going to be installed
                   Depends: libasound2-plugins:i386 but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
root@wmp-Aspire-3830TG:/home/wmp# clean
Sorry, command-not-found has crashed! Please file a bug report at:
https://bugs.launchpad.net/command-not-found/+filebug
Please include the following information with the report:

command-not-found version: 0.3
Python version: 3.3.1 candidate 1
Distributor ID: Ubuntu
Description: Ubuntu Raring Ringtail (development branch)
Release: 13.04
Codename: raring
Exception information:

unsupported locale setting
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/CommandNotFound/util.py", line 24, in crash_guard
    callback()
  File "/usr/lib/command-not-found", line 69, in main
    enable_i18n()
  File "/usr/lib/command-not-found", line 40, in enable_i18n
    locale.setlocale(locale.LC_ALL, '')
  File "/usr/lib/python3.3/locale.py", line 541, in setlocale
    return _setlocale(category, locale)
locale.Error: unsupported locale setting
root@wmp-Aspire-3830TG:/home/wmp#

Revision history for this message
memoTux (romeo-mendez) wrote :

command-not-found versi\xf3n: 0.3
Python versi\xf3n: 3.3.1 final 0
Distributor ID: Ubuntu
Description: Ubuntu 13.04
Release: 13.04
Codename: raring
Informaci\xf3n de la excepci\xf3n:

unsupported locale setting
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/CommandNotFound/util.py", line 24, in crash_guard
    callback()
  File "/usr/lib/command-not-found", line 69, in main
    enable_i18n()
  File "/usr/lib/command-not-found", line 40, in enable_i18n
    locale.setlocale(locale.LC_ALL, '')
  File "/usr/lib/python3.3/locale.py", line 541, in setlocale
    return _setlocale(category, locale)
locale.Error: unsupported locale setting

locale output
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: No se puede establecer LC_ALL al local predeterminado: No existe el archivo o el directorio
LANG=es_SV.UTF-8
LANGUAGE=es_SV:es
LC_CTYPE=UTF-8
LC_NUMERIC="es_SV.UTF-8"
LC_TIME="es_SV.UTF-8"
LC_COLLATE="es_SV.UTF-8"
LC_MONETARY="es_SV.UTF-8"
LC_MESSAGES="es_SV.UTF-8"
LC_PAPER="es_SV.UTF-8"
LC_NAME="es_SV.UTF-8"
LC_ADDRESS="es_SV.UTF-8"
LC_TELEPHONE="es_SV.UTF-8"
LC_MEASUREMENT="es_SV.UTF-8"
LC_IDENTIFICATION="es_SV.UTF-8"
LC_ALL=

Revision history for this message
Hans Joachim Desserud (hjd) wrote :

This issue is still present in command-not-found 0.3ubuntu7 in Ubuntu Saucy.

tags: added: raring saucy
Changed in command-not-found (Ubuntu):
status: New → Confirmed
Changed in command-not-found (Ubuntu):
status: Confirmed → Triaged
importance: Undecided → High
Changed in hundredpapercuts:
assignee: nobody → Paper Cuts Ninja (papercuts-ninja)
status: New → Confirmed
Revision history for this message
bnuytten (bjorn-nuyttens) wrote :

bjorn@jupiter:~$ vncviewer
Sorry, command-not-found has crashed! Please file a bug report at:
https://bugs.launchpad.net/command-not-found/+filebug
Please include the following information with the report:

command-not-found version: 0.3
Python version: 3.3.1 final 0
Distributor ID: Ubuntu
Description: Ubuntu 13.04
Release: 13.04
Codename: raring
Exception information:

unsupported locale setting
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/CommandNotFound/util.py", line 24, in crash_guard
    callback()
  File "/usr/lib/command-not-found", line 69, in main
    enable_i18n()
  File "/usr/lib/command-not-found", line 40, in enable_i18n
    locale.setlocale(locale.LC_ALL, '')
  File "/usr/lib/python3.3/locale.py", line 541, in setlocale
    return _setlocale(category, locale)
locale.Error: unsupported locale setting
bjorn@jupiter:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 13.04
Release: 13.04
Codename: raring
bjorn@jupiter:~$ locale
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=en_US.UTF-8
LANGUAGE=en_US:en
LC_CTYPE=custom.UTF-8
LC_NUMERIC=custom.UTF-8
LC_TIME=custom.UTF-8
LC_COLLATE=custom.UTF-8
LC_MONETARY=custom.UTF-8
LC_MESSAGES=custom.UTF-8
LC_PAPER=custom.UTF-8
LC_NAME=custom.UTF-8
LC_ADDRESS=custom.UTF-8
LC_TELEPHONE=custom.UTF-8
LC_MEASUREMENT=custom.UTF-8
LC_IDENTIFICATION=custom.UTF-8
LC_ALL=
bjorn@jupiter:~$ dpkg --list command-not-found
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-===================-==============-==============-============================================
ii command-not-found 0.3ubuntu7.1 all Suggest installation of packages in interact

Changed in hundredpapercuts:
status: Confirmed → Triaged
importance: Undecided → High
Revision history for this message
Nick (nicky-nick-nickleton) wrote :
Jackson Doak (noskcaj)
Changed in command-not-found:
status: Confirmed → Fix Committed
Changed in hundredpapercuts:
status: Triaged → Fix Committed
Changed in command-not-found (Ubuntu):
status: Triaged → Fix Committed
Changed in hundredpapercuts:
assignee: Papercuts Ninjas (papercuts-ninja) → nobody
Revision history for this message
Sebastian Pawluś (sebastian-pawlus) wrote :
Revision history for this message
Sebastian Pawluś (sebastian-pawlus) wrote :

Sorry for comment after comment.
But maybe it's something else, anyway. This appears when you are trying to use command that doesn't exist.

vagrant@vagrant-ubuntu-saucy-64:~$ htop
Sorry, command-not-found has crashed! Please file a bug report at:
https://bugs.launchpad.net/command-not-found/+filebug
Please include the following information with the report:

command-not-found version: 0.3
Python version: 3.3.2 final 0
Distributor ID: Ubuntu
Description: Ubuntu 13.10
Release: 13.10
Codename: saucy
Exception information:

unsupported locale setting
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/CommandNotFound/util.py", line 24, in crash_guard
    callback()
  File "/usr/lib/command-not-found", line 69, in main
    enable_i18n()
  File "/usr/lib/command-not-found", line 40, in enable_i18n
    locale.setlocale(locale.LC_ALL, '')
  File "/usr/lib/python3.3/locale.py", line 541, in setlocale
    return _setlocale(category, locale)
locale.Error: unsupported locale setting

Revision history for this message
Oliver Bestwalter (3-oliver) wrote :

Hi,

same problem still in the newest daily build for trusty tar in vagrant image from http://cloud-images.ubuntu.com/vagrant/trusty/20140222/trusty-server-cloudimg-amd64-vagrant-disk1.box

Welcome to Ubuntu Trusty Tahr (development branch) (GNU/Linux 3.13.0-11-generic x86_64)

 * Documentation: https://help.ubuntu.com/

 System information disabled due to load higher than 1.0

  Get cloud support with Ubuntu Advantage Cloud Guest:
    http://www.ubuntu.com/business/services/cloud

----
vagrant@vagrant-ubuntu-trusty-64:~$ idontexist
Sorry, command-not-found has crashed! Please file a bug report at:
https://bugs.launchpad.net/command-not-found/+filebug
Please include the following information with the report:

command-not-found version: 0.3
Python version: 3.4.0 candidate 1
Distributor ID: Ubuntu
Description: Ubuntu Trusty Tahr (development branch)
Release: 14.04
Codename: trusty
Exception information:

unsupported locale setting
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/CommandNotFound/util.py", line 24, in crash_guard
    callback()
  File "/usr/lib/command-not-found", line 69, in main
    enable_i18n()
  File "/usr/lib/command-not-found", line 40, in enable_i18n
    locale.setlocale(locale.LC_ALL, '')
  File "/usr/lib/python3.4/locale.py", line 592, in setlocale
    return _setlocale(category, locale)
locale.Error: unsupported locale setting

----

There seems to be an underlying problem with locale in this build:

vagrant@vagrant-ubuntu-trusty-64:~$ locale
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=en_US.UTF-8
LANGUAGE=
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC=de_DE.UTF-8
LC_TIME=en_DK.UTF-8
LC_COLLATE="en_US.UTF-8"
LC_MONETARY=de_DE.UTF-8
LC_MESSAGES=C
LC_PAPER=de_DE.UTF-8
LC_NAME=de_DE.UTF-8
LC_ADDRESS=de_DE.UTF-8
LC_TELEPHONE=de_DE.UTF-8
LC_MEASUREMENT=de_DE.UTF-8
LC_IDENTIFICATION=de_DE.UTF-8
LC_ALL=

Changed in command-not-found (Ubuntu):
status: Fix Committed → Confirmed
Changed in command-not-found (Ubuntu):
status: Confirmed → Triaged
Changed in command-not-found (Ubuntu):
status: Triaged → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package command-not-found - 0.3ubuntu10

---------------
command-not-found (0.3ubuntu10) trusty; urgency=medium

  [ Anthony Wong ]
  * Fix locale.Error: unsupported locale setting bug (LP: #1029204)
 -- Dimitri John Ledkov <email address hidden> Fri, 21 Mar 2014 12:04:22 +0000

Changed in command-not-found (Ubuntu):
status: Fix Committed → Fix Released
Changed in command-not-found:
status: Fix Committed → Fix Released
Changed in hundredpapercuts:
status: Fix Committed → Fix Released
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/1029204

tags: added: package-qa-testing
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.