seth vidal wrote:
On Thu, 2008-02-21 at 11:10 +0100, Tim Lauridsen wrote:
i have some problems with using YumBase.searchGenerator from the PackageKit yum2 backend (dbus based backend).

       searchlist = ['name', 'summary', 'description', 'group']
       key = 'firmware'                 
       res = self.yumbase.searchGenerator(searchlist, [key])
       for (pkg,values) in res:
        # do some action

i get this

org.freedesktop.DBus.Python.UnicodeDecodeError: Traceback (most recent call last): File "/usr/lib/python2.5/site-packages/dbus/service.py", line 655, in _message_cb
     retval = candidate_method(self, *args, **keywords)
   File "./yumDBUSBackend.py", line 388, in SearchDetails
     successful = self._do_search(searchlist, filters, key)
   File "./yumDBUSBackend.py", line 1014, in _do_search
     for (pkg,values) in res:
File "/data/udv/work/PackageKit/backends/yum2/helpers/yum/__init__.py", line 1488, in searchGenerator
     if value and value.lower().find(s) != -1:
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 19: ordinal not in range(128)

if is caused because value is a bytestring contain a non ascii char.

i can only reproduce it if the code is call from a dbus method, it works fine if i run the code as a normal python script.

the attached patch fixes the issue, does any body have any objection to commit the patch.


Curiously we have the same problem with the kyum caller here:
https://bugzilla.redhat.com/show_bug.cgi?id=433168

My only question is - what's going on that makes it work when not being
called from a c program? Is the program not exporting an environment
variable properly?

In this case it is

python (test script) -> dbus -> python (yum2 backend)

I dont have a clue what goes on.

Tim
_______________________________________________
Yum-devel mailing list
[email protected]
https://lists.dulug.duke.edu/mailman/listinfo/yum-devel

Reply via email to