command-not-found crashed in advise with: UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 45: ordinal not in range(128)

Bug #920860 reported by David Henningsson
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
command-not-found (Ubuntu)
Triaged
Medium
Unassigned

Bug Description

On an up-to-date 12.04 installation, swedish language:

$ LC_ALL=C chuck
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

(note: the command "chuck" is not currently installed)

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: command-not-found 0.2.46ubuntu1
ProcVersionSignature: Ubuntu 3.2.0-10.17-generic 3.2.1
Uname: Linux 3.2.0-10-generic x86_64
ApportVersion: 1.91-0ubuntu1
Architecture: amd64
Date: Tue Jan 24 09:33:11 2012
EcryptfsInUse: Yes
InstallationMedia: Ubuntu 12.04 LTS "Precise Pangolin" - Alpha amd64 (20120103)
PackageArchitecture: all
SourcePackage: command-not-found
UpgradeStatus: No upgrade log present (probably fresh install)

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

I have a patch that will eventually address this problem but for the moment let me just state that C locale is broken by design and prevents python from working with UTF-8 (at all). Don't use it.

Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

Thanks for your report.

Here is the error
Traceback (most recent call last):
  File "/usr/lib/command-not-found", line 90, in <module>
    main()
  File "/usr/lib/command-not-found", line 85, in main
    if not cnf.advise(args[0].encode('utf-8'), options.ignore_installed) and not options.no_failure_msg:
  File "/usr/lib/python2.7/dist-packages/CommandNotFound/CommandNotFound.py", line 252, in advise
    print >> sys.stderr, _("The program '%s' is currently not installed. ") % command,
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 45: ordinal not in range(128)

Changed in command-not-found (Ubuntu):
status: New → Triaged
importance: Undecided → Medium
summary: - Sorry, command-not-found has crashed!
+ command-not-found crashed in advise with: UnicodeEncodeError: 'ascii'
+ codec can't encode character u'\xe9' in position 45: ordinal not in
+ range(128)
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.