Comment 13 for bug 978654

Revision history for this message
Alkis Georgopoulos (alkisg) wrote : Re: <type 'exceptions.UnicodeDecodeError'>: 'ascii' codec can't decode byte 0xc3 in position 24: ordinal not in range(128)

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)