GNOME Bugzilla – Bug 588124
Python calls to Inhibit() are crashing
Last modified: 2009-07-20 21:14:52 UTC
Steps to reproduce: 1. Call the inhibit functions either by using "gnome-power-manager-inhibit test" or following the examples at the FAQ or bug 472812. (/usr/bin/gnome-power-manager-inhibit) 2. The Inhibit function will crash An example Python script which works in 2.24 but not in 2.27: #!/usr/bin/env python import dbus bus = dbus.SessionBus() devobj = bus.get_object('org.freedesktop.PowerManagement', '/org/freedesktop/PowerManagement/Inhibit') power = dbus.Interface(devobj, "org.freedesktop.PowerManagement.Inhibit") cookie = power.Inhibit('application name', 'reason') power.UnInhibit(cookie) Stack trace: Traceback (most recent call last):
+ Trace 216362
cookie = gpm.Inhibit("Command Line: " + sys.argv[1], "Long Execution")
return self._proxy_method(*args, **keywords)
**keywords)
message, timeout)
Other information: Additionally, I have not been able to get the inhibit applet to work at all in GPM 2.27. When I click on it on the panel, nothing happens. Nothing shows up on gnome-power-manager --no-daemon --verbose or across the dbus-monitor --session "type='signal',interface='org.freedesktop.PowerManagement'" when I attempt to use the inhibit applet in the gnome panel. If these are two bugs, they should be separated out - but I have a feeling that they are related (but no data to back that up yet). Original downstream reports: https://bugs.launchpad.net/ubuntu/+source/gnome-power-manager/+bug/383637 https://bugs.launchpad.net/bugs/389857
Created attachment 138083 [details] output from gnome-power-bugreport
ubuntu@ubuntu:~$ polkit-auth | grep power-management org.freedesktop.hal.power-management.shutdown org.freedesktop.hal.power-management.shutdown-multiple-sessions org.freedesktop.hal.power-management.reboot org.freedesktop.hal.power-management.reboot-multiple-sessions org.freedesktop.hal.power-management.set-powersave org.freedesktop.hal.power-management.suspend org.freedesktop.hal.power-management.hibernate org.freedesktop.hal.power-management.cpufreq org.freedesktop.hal.power-management.lcd-panel org.freedesktop.hal.power-management.light-sensor org.freedesktop.hal.power-management.keyboard-backlight
*** This bug has been marked as a duplicate of 472812 ***