command-not-found crashed when using non-ascii characters (eg: é, à, è)

Bug #936355 reported by Alexandre Rose
48
This bug affects 10 people
Affects Status Importance Assigned to Milestone
command-not-found
New
Undecided
Unassigned

Bug Description

command-not-found seems to be unable to handle unknown charaters such as (é, à, è, û)

Here is the message it returns:

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

Revision history for this message
hyber@hyber.dk (hyberhyber.dk) wrote :

It also affects version 0.3, in my Ubuntu Quantal..

I can also see that the letter "æ" "ø" and "å" also makes it crash..

Here is a trace:

root@nas:~# æ
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:

'utf-8' codec can't encode character '\udce6' in position 0: surrogates not allowed
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 87, in main
    if not cnf.advise(args[0], options.ignore_installed) and not options.no_failure_msg:
  File "/usr/lib/python3/dist-packages/CommandNotFound/CommandNotFound.py", line 265, in advise
    packages = self.getPackages(command)
  File "/usr/lib/python3/dist-packages/CommandNotFound/CommandNotFound.py", line 157, in getPackages
    result.update([(pkg, db.component) for pkg in db.lookup(command)])
  File "/usr/lib/python3/dist-packages/CommandNotFound/CommandNotFound.py", line 85, in lookup
    result = self.db.lookup(command)
  File "/usr/lib/python3/dist-packages/CommandNotFound/CommandNotFound.py", line 41, in lookup
    key = key.encode('utf-8')
UnicodeEncodeError: 'utf-8' codec can't encode character '\udce6' in position 0: surrogates not allowed
root@nas:~#

Cheers

Esben

no longer affects: ubuntu
Revision history for this message
Jack2 (jack-2-f) wrote :

Same here with Ubuntu 12.04,
sometimes I press the "ù" key which is near the enter key, my kayboard has an Italian layout.

The error message is:

hari@laptopB:~$ javaù
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

Revision history for this message
Mattias Evensson (mevensson) wrote :

I got the same crash in 13.10 with the character 'ö'. Exactly same callstack as above.

command-not-found version: 0.3
Python version: 3.3.2 final 0
Distributor ID: Ubuntu
Description: Ubuntu Saucy Salamander (development branch)
Release: 13.10
Codename: saucy

Revision history for this message
Marco Hegenberg (marco-hegenberg) wrote :

Same as above with "ü", "ä" and "ö".

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

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.