unicode character crashes command-not-found application

Bug #1130444 reported by Stefan Dangl
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
command-not-found (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

$ off�
Die Anwendung command-not-found ist abgestürzt! Bitte berichten Sie über den Fehler unter:
https://bugs.launchpad.net/command-not-found/+filebug
Bitte führen Sie folgende Informationen im Fehlerbericht an:

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
Informationen zum Fehler:

'utf-8' codec can't encode character '\udcb6' in position 3: 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 '\udcb6' in position 3: surrogates not allowed

affects: command-not-found → command-not-found (Ubuntu)
no longer affects: ubuntu
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in command-not-found (Ubuntu):
status: New → Confirmed
Revision history for this message
Mark Shuttleworth (sabdfl) wrote :

This looks like a small fix to make command-not-found more resilient in the face of a typo. Any offers of a patch?

Michael Vogt (mvo)
Changed in command-not-found (Ubuntu):
status: Confirmed → In Progress
status: In Progress → Fix Committed
Revision history for this message
Michael Vogt (mvo) wrote :

Thanks for your bugreport. This is fixed in bzr now and the fix will be part of the next upload (which will happen once the data is updated on the server).

Revision history for this message
Launchpad Janitor (janitor) wrote :

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

---------------
command-not-found (0.3ubuntu13) utopic; urgency=low

  * add python3 suggestion if a user types "python"
    (LP: #1306682)
  * do not crash for invalid unicode (LP: #1130444)
  * update scan.data to latest utopic
 -- Michael Vogt <email address hidden> Wed, 16 Jul 2014 08:03:59 +0200

Changed in command-not-found (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related questions

Remote bug watches

Bug watches keep track of this bug in other bug trackers.