← Back to team overview

ubuntu-bugcontrol team mailing list archive

[Bug 846044] Re: software-center crashed with UnicodeEncodeError in get_dbus_message(): 'ascii' codec can't encode character u'\xfc' in position 65: ordinal not in range(128)

 

Looking at all the duplicate reports, this happens with any language
that uses non-ascii characters (those above ASCII 127) - potentially
every language but english.

However this only affects a few software packages; I was able to
correctly install vlc and flash plugin using a german-language system,
but installing mouse trap (the one that controls the mouse with the
webcam) fails and reproduces the error.

Steps to reproduce:

0 - I'm using a fully-updated Oneiric installation with software-center 4.1.22.
1 - Install a language that may contain non-ascii characters (the duplicates indicate this may happen in spanish (mexico), portuguese (portugal) and I managed to reproduce it in german (austria)):
   sudo apt-get install language-pack-de language-pack-gnome-de
2- Launch software center from a terminal, using this installed language:
  LANG=de_AT.UTF-8 LANGUAGE=de_AT:de software-center
3- Search for and try to install "mousetrap" (the mouse controlling app, not the game)

Expected result: 
- App installs with no errors

Actual result:
- As described in the original report, software center crashes with the given trace.

It looks like somewhere, there is a call to the "unicode" python
function, which defaults to using the ascii encoder, so any character in
the string to be encoded that can't be encoded as 7-bit ascii will throw
the exception.

We saw something similar in bug 833747 and the solution was to
explicitly specify the encoder in the call to unicode:

unicode(string,"utf8") instead of unicode(string)

Of course, tracing the actual call to unicode was the tricky part as
this is sometimes done implicitly. Also this may cause "secondary
effects" and need code changes elsewhere (in bug 833747 we also required
some changes to the text sent to a Gtk.TextBuffer to force encoding the
unicode into utf8).

I'm setting this bug to triaged and importance: Critical as it has a
"severe impact in a large portion of Ubuntu users" - Unreliability and
crashes in Software Center, one of Ubuntu's flagship apps, for
potentially anyone not on an English locale seems pretty critical to me.

** Changed in: software-center (Ubuntu)
   Importance: Undecided => Critical

** Changed in: software-center (Ubuntu)
       Status: Confirmed => Triaged

-- 
You received this bug notification because you are a member of Ubuntu
Bug Control, which is subscribed to the bug report.
https://bugs.launchpad.net/bugs/846044

Title:
  software-center crashed with UnicodeEncodeError in get_dbus_message():
  'ascii' codec can't encode character u'\xfc' in position 65: ordinal
  not in range(128)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/software-center/+bug/846044/+subscriptions