UnicodeEncodeError: 'ascii' codec can't encode characters

Bug #870012 reported by Marco Biscaro on 2011-10-07
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
software-properties (Ubuntu)
Undecided
Unassigned

Bug Description

I've upgraded from natty to oneiric (sudo do-release-upgrade -d) and this added comments like "disabled in upgrade to oneiric" in /etc/apt/sources.list and in files in /etc/apt/sources.list.d.

The problem is: in Brazilian Portuguese, the comment is "desabilitado na atualização para oneiric" (it has unicode characters). When trying to remove, edit or enable these entries via software-properties-gtk, nothing happens.

Workaround: remove the comments manually from these files.

Running software-properties-gtk from a terminal, the following errors appear, when trying to remove and enable the entries, respectively:

Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/softwareproperties/gtk/SoftwarePropertiesGtk.py", line 839, in on_remove_clicked
    self.backend.RemoveSource(str(source_entry))
  File "/usr/lib/python2.7/dist-packages/dbus/proxies.py", line 143, in __call__
    **keywords)
  File "/usr/lib/python2.7/dist-packages/dbus/connection.py", line 630, in call_blocking
    message, timeout)
dbus.exceptions.DBusException: org.freedesktop.DBus.Python.UnicodeEncodeError: Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/dbus/service.py", line 702, in _message_cb
    retval = candidate_method(self, *args, **keywords)
  File "/usr/lib/python2.7/dist-packages/softwareproperties/dbus/SoftwarePropertiesDBus.py", line 268, in RemoveSource
    self.remove_source(str(source))
UnicodeEncodeError: 'ascii' codec can't encode characters in position 72-73: ordinal not in range(128)

-------------------------

Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/softwareproperties/gtk/SoftwarePropertiesGtk.py", line 647, in on_isv_source_toggled
    self.backend.ToggleSourceUse(str(source_entry))
  File "/usr/lib/python2.7/dist-packages/dbus/proxies.py", line 143, in __call__
    **keywords)
  File "/usr/lib/python2.7/dist-packages/dbus/connection.py", line 630, in call_blocking
    message, timeout)
dbus.exceptions.DBusException: org.freedesktop.DBus.Python.UnicodeEncodeError: Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/dbus/service.py", line 702, in _message_cb
    retval = candidate_method(self, *args, **keywords)
  File "/usr/lib/python2.7/dist-packages/softwareproperties/dbus/SoftwarePropertiesDBus.py", line 156, in ToggleSourceUse
    self.toggle_source_use(str(source))
UnicodeEncodeError: 'ascii' codec can't encode characters in position 72-73: ordinal not in range(128)

ProblemType: Bug
DistroRelease: Ubuntu 11.10
Package: software-properties-gtk 0.81.9
ProcVersionSignature: Ubuntu 3.0.0-12.19-generic 3.0.4
Uname: Linux 3.0.0-12-generic i686
ApportVersion: 1.23-0ubuntu2
Architecture: i386
Date: Fri Oct 7 10:51:58 2011
InstallationMedia: Ubuntu 11.04 "Natty Narwhal" - Release i386 (20110427.1)
PackageArchitecture: all
ProcEnviron:
 LANGUAGE=pt_BR:pt_PT:en
 PATH=(custom, no user)
 LANG=pt_BR.UTF-8
 LC_MESSAGES=pt_BR.UTF-8
 SHELL=/bin/bash
SourcePackage: software-properties
UpgradeStatus: Upgraded to oneiric on 2011-10-05 (1 days ago)

description: updated
Brian Murray (brian-murray) wrote :

This should be fixed in the newest version of software-properties.

Richard Kemp (richardtkemp) wrote :

I have this bug still on 12.04, using this version:

rich@RichU:~/temp$ dpkg -s software-properties-common
Package: software-properties-common
Status: install ok installed
Priority: optional
Section: admin
Installed-Size: 129
Maintainer: Michael Vogt <email address hidden>
Architecture: all
Source: software-properties
Version: 0.82.7.7
Depends: python2.7, python (>= 2.7.1-0ubuntu2), python (<< 2.8), python-gi, gir1.2-glib-2.0, python-dbus
Conffiles:
 /etc/dbus-1/system.d/com.ubuntu.SoftwareProperties.conf cc3c01a5b5e8e05d40c9c075f44c43ea
Description: manage the repositories that you install software from (common)
 This software provides an abstraction of the used apt repositories.
 It allows you to easily manage your distribution and independent software
 vendor software sources.
 .
 This package contains the common files for software-properties like the
 D-Bus backend.

..when using conkyGuayadeque.py like so:

rich@RichU:~/temp$ python conkyGuayadeque.py
ERROR: Issue calling the dbus service:'ascii' codec can't encode character u'\xf6' in position 25: ordinal not in range(128)

It doesn't like songs by, for example, Röyksopp. I note that version 0.82.7.7 of software-properties is much more recent than Brian's comment.

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

Other bug subscribers