software-properties-gtk crashed with UnicodeDecodeError in init_distro(): 'ascii' codec can't decode byte 0xd0 in position 0: ordinal not in range(128)

Bug #815480 reported by Ivan Akulov
304
This bug affects 45 people
Affects Status Importance Assigned to Milestone
software-properties (Ubuntu)
Fix Released
High
Unassigned
Oneiric
Fix Released
High
Unassigned

Bug Description

.

ProblemType: Crash
DistroRelease: Ubuntu 11.10
Package: software-properties-gtk 0.81.2
ProcVersionSignature: Ubuntu 3.0.0-6.7-generic 3.0.0-rc7
Uname: Linux 3.0.0-6-generic i686
NonfreeKernelModules: fglrx
Architecture: i386
Date: Sun Jul 24 19:38:18 2011
ExecutablePath: /usr/bin/software-properties-gtk
InstallationMedia: Ubuntu 11.10 "Oneiric Ocelot" - Alpha i386 (20110705)
InterpreterPath: /usr/bin/python2.7
PackageArchitecture: all
ProcCmdline: /usr/bin/python /usr/bin/software-properties-gtk --open-tab 2
ProcEnviron:
 PATH=(custom, no user)
 LANG=ru_UA.UTF-8
 LANGUAGE=ru_UA:ru
 SHELL=/bin/bash
PythonArgs: ['/usr/bin/software-properties-gtk', '--open-tab', '2']
SourcePackage: software-properties
Title: software-properties-gtk crashed with UnicodeDecodeError in init_distro(): 'ascii' codec can't decode byte 0xd0 in position 0: ordinal not in range(128)
UpgradeStatus: Upgraded to oneiric on 2011-07-17 (7 days ago)
UserGroups:

Revision history for this message
Ivan Akulov (gxoptg) wrote :
visibility: private → public
Changed in software-properties (Ubuntu):
status: New → Confirmed
Revision history for this message
Bowmore (bowmore) wrote :

I have the same issue for versions 0.81.2-0.81.4.
software-properties-gtk crashed with UnicodeDecodeError in init_distro(): 'ascii' codec can't decode byte 0xc3 in position 13: ordinal not in range(128)

It seems to be an ascii vs unicode issue introduced in version 0.81.2

A workaround atm is to downgrade to version 0.80.13.

Revision history for this message
L!S (andrew.lisichenko) wrote :

error appeared when trying to select "settings" in update manager.

Revision history for this message
Sebastien Bacher (seb128) wrote :

Confirmed on oneiric alpha3 with zn_CH locale

$ LANGUAGE=zh_CN gettext software-properties "%s Software"
%s 软件s

$ LANGUAGE=zh_CN python -c "import gettext; gettext.textdomain('software-properties'); print gettext.gettext('%s Software')"
%s 软件

but it breaks in software-properties

Changed in software-properties (Ubuntu):
importance: Undecided → High
Revision history for this message
Sebastien Bacher (seb128) wrote :

doing a print _("%s Software") % self.distro.id in SoftwarePropertiesGtk.py had the same issue than the set label call, but adding .encode('utf-8') makes it work...

Revision history for this message
Dmitry Tantsur (divius) wrote :

Devs should repeat 10 times: "I will never ever mix unicode and bytestrings. Especially in translatable strings." =(((

Revision history for this message
anonymous (anonymouz) wrote :
tags: added: patch
Revision history for this message
Evger (evger) wrote :

patch works

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package software-properties - 0.81.6

---------------
software-properties (0.81.6) oneiric; urgency=low

  [ Michael Vogt ]
  * softwareproperties/ppa.py:
    - show PPA description and confirm before adding
      (security-o-catch-all spec)

  [ Martin Pitt ]
  * softwareproperties/gtk/SoftwarePropertiesGtk.py: Fix encoding error,
    thanks to sokolov-m-v for the patch! (LP: #815480)
 -- Martin Pitt <email address hidden> Mon, 15 Aug 2011 10:25:51 +0200

Changed in software-properties (Ubuntu Oneiric):
status: Confirmed → Fix Released
Revision history for this message
Zooko Wilcox-O'Hearn (zooko) wrote :

By the way, this patch replaced a regexp with json.loads(): http://bazaar.launchpad.net/~ubuntu-branches/ubuntu/quantal/software-properties/quantal/revision/77

That was good, because a regexp could have been vulnerable to some sort of xss/injection sort of problem. But, the patch mistakenly left the following no-longer-true comment in place:

    # we ask for a JSON structure from lp_page, we could use
    # simplejson, but the format is simple enough for the regexp

That comment should be removed.

Revision history for this message
Michael Vogt (mvo) wrote :

Thanks Zooko, I removed the no longer applying comment from the source now.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.