Question about dbus.lowlevel.Message.set_sender in dbus-python

Huang Peng shawn.p.huang at gmail.com
Sat Sep 27 20:00:58 PDT 2008


HI Simon McVittie,

I found Message.set_sender method only accepts unique bus name. But in my
project, I need implement a simple dbus daemon, it need set the sender as
"org.freedesktop.DBus". Could you fix this problem? Thanks.

Below is the patch for fixing it.

BRs
Huang Peng

diff --git a/_dbus_bindings/message.c b/_dbus_bindings/message.c
index 8da8ffc..a2c04c3 100644
--- a/_dbus_bindings/message.c
+++ b/_dbus_bindings/message.c
@@ -606,7 +606,7 @@ Message_set_sender(Message *self, PyObject *args)
         return NULL;
     }
     if (!self->msg) return DBusPy_RaiseUnusableMessage();
-    if (!dbus_py_validate_bus_name(name, 1, 0)) return NULL;
+    if (!dbus_py_validate_bus_name(name, 1, 1)) return NULL;
     if (!dbus_message_set_sender(self->msg, name)) return PyErr_NoMemory();
     Py_RETURN_NONE;
 }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freedesktop.org/archives/dbus/attachments/20080928/5de92f42/attachment.html 


More information about the dbus mailing list