command-not-found crashing with incomplete locale settings
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
command-not-found (Ubuntu) |
Confirmed
|
Medium
|
Unassigned |
Bug Description
I'm running the latest 12.04 and I'm getting the following:
-------
mmrazik@fry:~$ logo
Sorry, command-not-found has crashed! Please file a bug report at:
https:/
Please include the following information with the report:
command-not-found version: 0.2.44
mmrazik@fry:~$
-------
This is probably 2 bugs in 1:
1. the crash itself
2. the message which tells you absolutely nothing what is going on
After some debugging I realized there is something wrong with my locale setup (to be honest I don't know how I get into this state; I have a fresh install with my old home and it looks like even though I selected the en_US locale the previous CS bits stayed somewhere in home).
-------
mmrazik@fry:~$ update-locale LANG=en_US.UTF-8
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = "en_US:en",
LC_ALL = (unset),
LC_PAPER = "cs_CZ.UTF-8",
LC_ADDRESS = "cs_CZ.UTF-8",
LC_MONETARY = "cs_CZ.UTF-8",
LC_NUMERIC = "cs_CZ.UTF-8",
LC_TELEPHONE = "cs_CZ.UTF-8",
LC_MEASUREMENT = "cs_CZ.UTF-8",
LC_TIME = "cs_CZ.UTF-8",
LC_NAME = "cs_CZ.UTF-8",
LANG = "en_US.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
update-locale: Unable to write /etc/default/
mmrazik@fry:~$
-------
I found out there is no cs dir in /usr/share/
mmrazik@fry:~$ sudo apt-get install language-pack-cs
I'm getting:
mmrazik@fry:~$ logo
The program 'logo' is currently not installed. You can install it by typing:
sudo apt-get install ucblogo
mmrazik@fry:~$
How to reproduce:
- set your locale to a language with no language pack installed
- run command-not-found
- observe the crash
command-not-found should have printed some more information as seen in the following:
print >> sys.stderr, _("command- not-found version: %s") % version
import subprocess
subprocess. call([" lsb_release" , "-i", "-d", "-r", "-c"], stdout=sys.stderr)
pass
import traceback
traceback. print_exc( )
pass
print >> sys.stderr, _("Python version: %d.%d.%d %s %d") % sys.version_info
try:
except (ImportError, OSError):
print >> sys.stderr, _("Exception information:")
print >> sys.stderr
print >> sys.stderr, ex
try:
except ImportError:
Regardless I don't think command-not-found tell people goto to +filebug but rather launch ubuntu-bug for you or just let apport catch the crash. I'll open a separate bug for that.