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)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Aptdaemon |
Fix Released
|
Undecided
|
C.Tenschert | ||
Python Dbus |
Fix Released
|
Medium
|
|||
aptdaemon (Ubuntu) |
Fix Released
|
Critical
|
Michael Vogt | ||
Oneiric |
Fix Released
|
Critical
|
Michael Vogt | ||
Quantal |
Fix Released
|
Critical
|
Michael Vogt | ||
dbus-python (Ubuntu) |
Fix Released
|
High
|
Barry Warsaw | ||
Oneiric |
Won't Fix
|
High
|
Michael Vogt | ||
Quantal |
Fix Released
|
High
|
Barry Warsaw |
Bug Description
TEST CASE (for dbus-python):
1. mkdir /tmp/äää
2. download google-
3. copy deb to /tmp/äää
4. run software-center /tmp/ää/
5. click on "install" and verify that there is a crash in the log that is displayed in the terminal
6. now install python-dbus from quantal-proposed and restart software-center
7. verify that the crash is no longer there when repeating step 4
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
ProcVersionSign
Uname: Linux 3.0.0-10-
NonfreeKernelMo
ApportVersion: 1.22.1-0ubuntu2
Architecture: i386
Date: Fri Sep 9 23:31:38 2011
ExecutablePath: /usr/share/
InstallationMedia: Ubuntu 11.10 "Oneiric Ocelot" - Beta i386 (20110901)
InterpreterPath: /usr/bin/python2.7
PackageArchitec
ProcCmdline: /usr/bin/python /usr/bin/
ProcEnviron:
PATH=(custom, no user)
LANG=de_DE.UTF-8
SHELL=/bin/bash
PythonArgs: ['/usr/
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
Related branches
- Aptdaemon Developers: Pending requested
-
Diff: 108 lines (+66/-1)4 files modifiedaptdaemon/errors.py (+8/-1)
tests/_test_py2_string_handling.py (+9/-0)
tests/_test_py3_string_handling.py (+46/-0)
tests/test_py2_string_handling.py (+3/-0)
- Barry Warsaw (community): Approve
- Ubuntu branches: Pending requested
-
Diff: 240 lines (+210/-1)4 files modifieddebian/changelog (+8/-0)
debian/control (+2/-1)
debian/patches/fdo55899.patch (+199/-0)
debian/patches/series (+1/-0)
- Michael Vogt (community): Approve
-
Diff: 239 lines (+209/-1)4 files modifieddebian/changelog (+7/-0)
debian/control (+2/-1)
debian/patches/fdo-bug-55899.patch (+199/-0)
debian/patches/series (+1/-0)
tags: | removed: need-duplicate-check |
Changed in software-center (Ubuntu): | |
status: | New → Confirmed |
tags: | added: bugpattern-needed |
visibility: | private → public |
affects: | software-center (Ubuntu) → aptdaemon (Ubuntu) |
Changed in aptdaemon (Ubuntu): | |
status: | Fix Released → In Progress |
tags: | added: rls-mgr-o-tracking |
Changed in aptdaemon (Ubuntu Oneiric): | |
assignee: | nobody → Michael Vogt (mvo) |
Changed in aptdaemon: | |
status: | New → Fix Released |
Changed in dbus-python (Ubuntu Oneiric): | |
status: | New → In Progress |
importance: | Undecided → High |
Changed in dbus-python (Ubuntu Quantal): | |
status: | New → In Progress |
importance: | Undecided → High |
Changed in dbus-python (Ubuntu Oneiric): | |
assignee: | nobody → Michael Vogt (mvo) |
Changed in dbus-python (Ubuntu Oneiric): | |
status: | In Progress → Won't Fix |
Changed in python-dbus: | |
importance: | Unknown → Medium |
status: | Unknown → Confirmed |
Changed in python-dbus: | |
status: | Confirmed → Fix Released |
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. pack-gnome- de
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-
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.