Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Examples on SlipDBus Trac site do not work. #3

Open
awood opened this issue May 20, 2016 · 0 comments
Open

Examples on SlipDBus Trac site do not work. #3

awood opened this issue May 20, 2016 · 0 comments

Comments

@awood
Copy link

awood commented May 20, 2016

Environment: Fedora 23, Python 2.7.11, python-slip 0.6.4, dbus-python 1.2.0, dbus 1.10.8

The example provided on https://fedorahosted.org/python-slip/wiki/SlipDBusService is not working.

  • The Python interpreter throws an error if the scripts are used as it:

    Traceback (most recent call last):
      File "./service.py", line 29, in <module>
        run_service ()
      File "./service.py", line 22, in run_service
        example_object = example_object.ExampleObject (name, "/org/example/ExampleObject")
    UnboundLocalError: local variable 'example_object' referenced before assignment
    
  • Renaming that variable leads to a service that just times out.

    % ./service.py &
    [1] 20622
    Running the example dbus service at 'org.example.ExampleService'.
    % dbus-send --session --print-reply --type=method_call --dest='org.example.ExampleService' '/org/example/ExampleObject' org.example.ExampleObject.hello_world  
    Error org.freedesktop.DBus.Error.NoReply: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
    [1]  + 20622 done       ./service.py  
    

    Walking through with the debugger, it looks like when slip adds the ASYNC_CALLBACKS tuple, those values confuse dbus.service into thinking the method is an async method. It looks like slip is attempting to remove those dummy ASYNC_CALLBACKS values if the method is not async, but it's not working. When the code returns to

    # we're done - the method has got callback functions to reply with
    if parent_method._dbus_async_callbacks:
        return
    

    in dbus.service, parent_method still has values in the _dbus_async_callbacks tuple.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant