[Bug 978654] Re: <type 'exceptions.UnicodeDecodeError'>: 'ascii' codec can't decode byte 0xc3 in position 24: ordinal not in range(128)

Alkis Georgopoulos 978654 at bugs.launchpad.net
Thu Sep 13 20:47:55 UTC 2012


The problem is probably that dbus.String() expects a unicode string, and aptdaemon is sending a utf-8 string.
Maybe is should be using value.decode("utf-8") instead:
self._last_package = dbus.String(value.decode("utf-8"))


Python example:

$ python
>>> import dbus
>>> s="Hi in Greek is Γεια"
>>> dbus.String(s.decode("utf-8"))
dbus.String(u'Hi in Greek is \u0393\u03b5\u03b9\u03b1')
>>> dbus.String(s)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
UnicodeDecodeError: 'ascii' codec can't decode byte 0xce in position 15: ordinal not in range(128)

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to aptdaemon in Ubuntu.
https://bugs.launchpad.net/bugs/978654

Title:
  <type 'exceptions.UnicodeDecodeError'>: 'ascii' codec can't decode
  byte 0xc3 in position 24: ordinal not in range(128)

Status in Aptdaemon:
  New
Status in “aptdaemon” package in Ubuntu:
  Confirmed

Bug description:
  No noticable problems - this message came up during boot

  ProblemType: Crash
  DistroRelease: Ubuntu 12.04
  Package: aptdaemon 0.43+bzr805-0ubuntu1
  ProcVersionSignature: Ubuntu 3.2.0-23.36-generic-pae 3.2.14
  Uname: Linux 3.2.0-23-generic-pae i686
  NonfreeKernelModules: nvidia
  Annotation: Search failed
  ApportVersion: 2.0.1-0ubuntu1
  Architecture: i386
  Date: Tue Apr 10 07:45:48 2012
  ExecutablePath: /usr/sbin/aptd
  PackageArchitecture: all
  SourcePackage: aptdaemon
  Title: <type 'exceptions.UnicodeDecodeError'>: 'ascii' codec can't decode byte 0xc3 in position 24: ordinal not in range(128)
  TransactionDepends: [[], [], [], [], [], [], []]
  TransactionErrorCode: error-unknown
  TransactionKwargs: {'filters': [u'unknown']}
  TransactionLocale: en_GB.UTF-8
  TransactionOutput:
   
  TransactionPackages: [[], [], [], [], [], []]
  TransactionRole: role-pk-query
  UpgradeStatus: Upgraded to precise on 2012-02-26 (44 days ago)

To manage notifications about this bug go to:
https://bugs.launchpad.net/aptdaemon/+bug/978654/+subscriptions




More information about the foundations-bugs mailing list