How could I control a DBus timeout with PolicyKit?
Mario
maacub at gmail.com
Fri Oct 1 00:53:34 PDT 2010
Hi! I have an application that uses PolicyKit.
If I do nothing (no password, no close window, no cancel button), I
get a DBus timeout.
I try to control it into my service with a "try:", but not works :(
Any idea, please?
Thanks in advance!
My code:
...........
try:
(is_auth, _, details) = self.polkit.CheckAuthorization(
('unix-process', {'pid': dbus.UInt32(pid, variant_level=1),
'start-time': dbus.UInt64(0, variant_level=1)}),
privilege, {'': ''}, dbus.UInt32(1), '', timeout=600)
except:
raise # <----- This not get the timeout exception.
............
The exception:
user at ubuntu:~/Desktop$ python 1.py
Traceback (most recent call last):
File "1.py", line 5, in <module>
print(iface.fw_unblock())
File "/usr/lib/pymodules/python2.6/dbus/proxies.py", line 68, in __call__
return self._proxy_method(*args, **keywords)
File "/usr/lib/pymodules/python2.6/dbus/proxies.py", line 140, in __call__
**keywords)
File "/usr/lib/pymodules/python2.6/dbus/connection.py", line 620, in
call_blocking
message, timeout)
dbus.exceptions.DBusException: 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.
user at ubuntu:~/Desktop$ python 1.py
More information about the dbus
mailing list