Comment 2 for bug 997769

Revision history for this message
Massimo Dal Zotto (dz) wrote :

The program /usr/lib/command-not-found always crashes on a fresh installation of ubuntu-server 12.04.

It doesn't crash on ubuntu-desktop (upgraded from 11.10 to 12.04).

The crash seems related to the environment variable LC_TIME. The program crashes if LC_TIME is set to any locale except C:

### CRASHES ###
LC_TIME=it_IT.UTF-8 /usr/lib/command-not-found -- traceroute

### works ###
LC_TIME=C /usr/lib/command-not-found -- traceroute

### works ###
LC_TIME= /usr/lib/command-not-found -- traceroute

Thus the bug can be avoided adding the following code to /usr/lib/command-not-found:

try:
    import os
    del os.environ["LC_TIME"]
except:
    pass

Obviously this is only a workaround until the bug is fixed.