command-not-found crashes

Bug #205050 reported by Andreas Jurreit
70
This bug affects 2 people
Affects Status Importance Assigned to Milestone
command-not-found (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: command-not-found

Please include the following information with the report:
unsupported locale setting
Traceback (most recent call last):
  File "/usr/lib/command-not-found", line 19, in <module>
    parser = OptionParser(version = __version__, usage=_("%prog [options] <command-name>"))
  File "/usr/lib/python2.5/gettext.py", line 584, in lgettext
    return ldgettext(_current_domain, message)
  File "/usr/lib/python2.5/gettext.py", line 556, in ldgettext
    return t.lgettext(message)
  File "/usr/lib/python2.5/gettext.py", line 366, in lgettext
    return tmsg.encode(locale.getpreferredencoding())
  File "/usr/lib/python2.5/locale.py", line 514, in getpreferredencoding
    setlocale(LC_CTYPE, "")
  File "/usr/lib/python2.5/locale.py", line 478, in setlocale
    return _setlocale(category, locale)
Error: unsupported locale setting
Python version: 2.5.2 final 0

Revision history for this message
Kai Kunschke (kk-altf4) wrote :

same problem here. solved it by setting all variables containing "de_DE@euro" to "de_DE.UTF8"

Revision history for this message
hellekin (hellekin) wrote : More of the same

root@now:~# hot now.cepheide.org
Sorry, command-not-found has crashed! Please file a bug report at:
https://bugs.launchpad.net/ubuntu/+source/command-not-found
Please include the following information with the report:
'ascii' codec can't encode character u'\xe9' in position 52: ordinal not in range(128)
Traceback (most recent call last):
  File "/usr/lib/command-not-found", line 22, in <module>
    help=_("use this path to locate data fields"))
  File "/usr/lib/python2.5/gettext.py", line 584, in lgettext
    return ldgettext(_current_domain, message)
  File "/usr/lib/python2.5/gettext.py", line 556, in ldgettext
    return t.lgettext(message)
  File "/usr/lib/python2.5/gettext.py", line 366, in lgettext
    return tmsg.encode(locale.getpreferredencoding())
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 52: ordinal not in range(128)
root@now:~# host now.cepheide.org

Revision history for this message
Jeroen van der Vegt (ajvdvegt) wrote :

I got the same stacktrace after setting my LANG to nl_NL instead of nl_NL.UTF8 to work around this bug: http://ubuntu-virginia.ubuntuforums.org/showthread.php?t=900387.

Revision history for this message
Colin Watson (cjwatson) wrote :

This was fixed a little while back by adding a guard around all gettext calls:

command-not-found (0.2.22ubuntu1) intrepid; urgency=low

  [ Zygmunt Krynicki ]
  * Fixed some locale issues and enchanced error reporting

  [ Michael Vogt ]
  * scan.data:
    - updated to current intrepid

 -- Michael Vogt <email address hidden> Mon, 11 Aug 2008 18:24:21 +0200

Colin Watson (cjwatson)
Changed in command-not-found:
status: New → Fix Released
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.