← Back to team overview

desktop-packages 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 Desktop
Packages, which is subscribed to software-center in Ubuntu.
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)

Status in “software-center” package in Ubuntu:
  Triaged

Bug description:
  I've tried to install an program. After clicking on "install" and
  entered password, the software center crashes.

  ProblemType: Crash
  DistroRelease: Ubuntu 11.10
  Package: software-center 4.1.22
  ProcVersionSignature: Ubuntu 3.0.0-10.16-generic-pae 3.0.4
  Uname: Linux 3.0.0-10-generic-pae i686
  NonfreeKernelModules: fglrx
  ApportVersion: 1.22.1-0ubuntu2
  Architecture: i386
  Date: Fri Sep  9 23:31:38 2011
  ExecutablePath: /usr/share/software-center/software-center
  InstallationMedia: Ubuntu 11.10 "Oneiric Ocelot" - Beta i386 (20110901)
  InterpreterPath: /usr/bin/python2.7
  PackageArchitecture: all
  ProcCmdline: /usr/bin/python /usr/bin/software-center
  ProcEnviron:
   PATH=(custom, no user)
   LANG=de_DE.UTF-8
   SHELL=/bin/bash
  PythonArgs: ['/usr/bin/software-center']
  SourcePackage: software-center
  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)
  UpgradeStatus: No upgrade log present (probably fresh install)
  UserGroups: adm admin cdrom dialout lpadmin plugdev sambashare

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