Bug 19426 - Python PackageKit API is broken
Summary: Python PackageKit API is broken
Status: RESOLVED FIXED
Alias: None
Product: PackageKit
Classification: Unclassified
Component: General (show other bugs)
Version: unspecified
Hardware: x86 (IA32) Linux (All)
: medium normal
Assignee: Richard Hughes
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-01-06 09:58 UTC by Matthias
Modified: 2009-01-20 10:32 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matthias 2009-01-06 09:58:31 UTC
Hello! (I hope I selected the right category for this bug)
PackageKit-Version: 0.4.1-GIT
I tried to install an local DEB-Package with the Python PackageKit backend and got the following error:

>>> pk.install_files(0,'/tmp/package.deb')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.5/site-packages/packagekit/client.py", line 364, in install_files
    exit_handler)
  File "/usr/lib/python2.5/site-packages/packagekit/client.py", line 447, in _run_transaction
    return trans.run()
  File "/usr/lib/python2.5/site-packages/packagekit/client.py", line 162, in run
    polkit_auth_wrapper(self._method, *self._args)
  File "/usr/lib/python2.5/site-packages/packagekit/client.py", line 461, in polkit_auth_wrapper
    return fn(*args, **kwargs)
  File "/var/lib/python-support/python2.5/dbus/proxies.py", line 140, in __call__
    **keywords)
  File "/var/lib/python-support/python2.5/dbus/connection.py", line 622, in call_blocking
    message, timeout)
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.UnknownMethod: Method "InstallFiles" with signature "is" on interface "org.freedesktop.PackageKit.Transaction" doesn't exist

This error also affects the search_file method:
>>> pk.search_file('libqt4intf.so',FILTER_NONE)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.5/site-packages/packagekit/client.py", line 259, in search_file
    exit_handler)
  File "/usr/lib/python2.5/site-packages/packagekit/client.py", line 447, in _run_transaction
    return trans.run()
  File "/usr/lib/python2.5/site-packages/packagekit/client.py", line 162, in run
    polkit_auth_wrapper(self._method, *self._args)
  File "/usr/lib/python2.5/site-packages/packagekit/client.py", line 461, in polkit_auth_wrapper
    return fn(*args, **kwargs)
  File "/var/lib/python-support/python2.5/dbus/proxies.py", line 140, in __call__
    **keywords)
  File "/var/lib/python-support/python2.5/dbus/connection.py", line 622, in call_blocking
    message, timeout)
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.UnknownMethod: Method "SearchFile" with signature "s" on interface "org.freedesktop.PackageKit.Transaction" doesn't exist

I think the Python-PackageKit backend is not up to date. Can anyone fix this bug?
Comment 1 Richard Hughes 2009-01-08 05:57:54 UTC
commit 742a0ac7640bcf85cccefd7df4660579db990713
Author: Richard Hughes <richard@hughsie.com>
Date:   Thu Jan 8 13:56:44 2009 +0000

    bugfix: fix the python client library for SearchDetails and SearchFile. Fixes fd#19426

Comment 2 Richard Hughes 2009-01-08 05:59:35 UTC
>pk.install_files(0,'/tmp/package.deb')

You need to pass in an array of files, in this case:

pk.install_files(0,('/tmp/package.deb'))

would probably work. We should add that check in the client library. Unfortunately I'm no python legend, so if you know how to do this please email the mailing list and you can work with the pthon python guys there. Thanks.
Comment 3 Matthias 2009-01-08 06:38:46 UTC
Thank you for the information and sorry for that stupid question! As you see on my question, I'm not an Python-expert, but I will do my best to improve the Python interface. (I hadn't looked at the source-code of client.py to find the right argument...) If I find something what I can do I'll write it to the Python-Mailinglist.
Comment 4 Matthias 2009-01-08 09:56:23 UTC
Oh no, the same again! With the new patches, search_file works for me, but install_files throws the same errors:
(Python interactive test-shell)
>>> from packagekit.client import *
>>> pk = PackageKitClient()
>>> pk.install_files(0,('/tmp/xpack_2.0.0.68-1_i386.deb'))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.5/site-packages/packagekit/client.py", line 364, in install_files
    exit_handler)
  File "/usr/lib/python2.5/site-packages/packagekit/client.py", line 447, in _run_transaction
    return trans.run()
  File "/usr/lib/python2.5/site-packages/packagekit/client.py", line 162, in run
    polkit_auth_wrapper(self._method, *self._args)
  File "/usr/lib/python2.5/site-packages/packagekit/client.py", line 461, in polkit_auth_wrapper
    return fn(*args, **kwargs)
  File "/var/lib/python-support/python2.5/dbus/proxies.py", line 140, in __call__
    **keywords)
  File "/var/lib/python-support/python2.5/dbus/connection.py", line 622, in call_blocking
    message, timeout)
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.UnknownMethod: Method "InstallFiles" with signature "is" on interface "org.freedesktop.PackageKit.Transaction" doesn't exist

pk.install_files(0,['/tmp/xpack_2.0.0.68-1_i386.deb']) doesn't work also. You said "array", but there is no "array" datatype in Python. Must I pass an array-Object to the method?
Sorry for the confusion ;-)
Comment 5 Matthias 2009-01-20 10:32:37 UTC
Well, it seems to be fixed now! Thank you!


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.