command-not-found crashes on any input

Bug #1061390 reported by Michael Penkov
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
command-not-found
New
Undecided
Unassigned

Bug Description

Whenever I try an invalid command, I get this:

misha@misha-lmd:~$ foo
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.2.44

There is no further information. This was working until a day or two ago, at which point I performed a package update.

I'm using a fresh install of Precise 12.04.01 LTS. Please let me know if there is any other information that I can provide.

Revision history for this message
Michael Penkov (misha-penkov) wrote :

I've found the cause of the problem. I have the following in my .bashrc:

export LC_PAPER=a4

in order to work around problems with applications printing on US Letter paper by default. If I unset LC_PAPER, then command-not-found works as expected.

Why does setting LC_PAPER cause command-not-found to crash?

Revision history for this message
Zygmunt Krynicki (zyga) wrote :

Hi, thanks for the bug report.

I honestly don't know. I have little time to debug c-n-f now, would you mind helping me trace through the calls that lead to the crash?

Revision history for this message
Michael Penkov (misha-penkov) wrote : Re: [Bug 1061390] Re: command-not-found crashes on any input

On 4 October 2012 17:30, Zygmunt Krynicki
<email address hidden> wrote:
> Hi, thanks for the bug report.
>
> I honestly don't know. I have little time to debug c-n-f now, would you
> mind helping me trace through the calls that lead to the crash?

Sure. Here's what I see if I disable the crash_guard:

misha@misha-lmd:~/src/command-not-found-0.2.46ubuntu6$ python
command-not-found foo
Traceback (most recent call last):
  File "command-not-found", line 95, in <module>
    main()
  File "command-not-found", line 71, in main
    enable_i18n()
  File "command-not-found", line 31, in enable_i18n
    locale.setlocale(locale.LC_ALL, '')
  File "/usr/lib/python2.7/locale.py", line 539, in setlocale
    return _setlocale(category, locale)
locale.Error: unsupported locale setting

I don't think the problem is inside your actual application. If I do
the same thing in the interpreter:

misha@misha-lmd:~/src/command-not-found-0.2.46ubuntu6$ python
Python 2.7.3 (default, Aug 1 2012, 05:14:39)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import locale
>>> locale.setlocale(locale.LC_ALL, "")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/locale.py", line 539, in setlocale
    return _setlocale(category, locale)
locale.Error: unsupported locale setting

Again, if I unset LC_PAPER, then everything works fine, except my
applications print in US Letter by default (not great).

Any ideas?
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1061390
>
> Title:
> command-not-found crashes on any input
>
> Status in command-not-found handler:
> New
>
> Bug description:
> Whenever I try an invalid command, I get this:
>
> misha@misha-lmd:~$ foo
> 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.2.44
>
> There is no further information. This was working until a day or two
> ago, at which point I performed a package update.
>
> I'm using a fresh install of Precise 12.04.01 LTS. Please let me know
> if there is any other information that I can provide.
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/command-not-found/+bug/1061390/+subscriptions

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.