Hi,
first of all, since I'm new to the list I'd like to thank the people
responsible for PyQt a lot for making such a great project.
I'd like to report a bug: when using DBusQtMainLoop, I'm getting
SIGSEGVs when the DBus connection is closed. I've managed to reproduce
this from Ubuntu Lucid (PyQt 4.7.2) up to Ubuntu Precise beta 2 (PyQt
4.9.1).
Attached is a script that when ran shows the issue, but not every time;
on my Precise machine it happens about 3 out of 10 times; on a Lucid VM
it happens every time.
Please let me know if I should attach any other info, or if there's some
simple way to fix it that I'm missing.
BTW: I've seen this bug reported elsewhere[0] for projects using PyQt,
but I'm not sure where I should report it for PyQt.
thanks!
--
alecu
[0] other references to this same behaviour:
https://bugs.launchpad.net/ubuntu/+source/ubuntu-sso-client/+bug/943046
https://bugs.kde.org/show_bug.cgi?id=171572
https://bugs.launchpad.net/ubuntu/+source/python-qt4/+bug/334757
import os
import signal
from subprocess import Popen, PIPE, STDOUT
import sys
#import faulthandler
#faulthandler.enable()
import dbus
from PyQt4 import Qt
from dbus.mainloop.qt import DBusQtMainLoop
dbus_daemon = Popen(["dbus-daemon", "--session", "--print-address"],
stdout=PIPE, stderr=STDOUT)
address = dbus_daemon.stdout.readline().strip()
dbus_daemon.stdout.close()
os.environ["DBUS_SESSION_BUS_ADDRESS"] = address
DBUS_BUSNAME = "org.freedesktop.DBus"
DBUS_IFACE = "org.freedesktop.DBus"
DBUS_PATH = "/org/freedesktop/DBus"
def reply(names):
sys.stderr.write("reply: %r items\n" % len(names))
Qt.QTimer.singleShot(100, repeat_list_names)
def error(*args):
sys.stderr.write("error: %r\n" % args)
def repeat_list_names():
dbus_iface.ListActivatableNames(reply_handler=reply, error_handler=error)
def kill_daemon():
os.kill(dbus_daemon.pid, 9)
DBusQtMainLoop(set_as_default=True)
app = Qt.QApplication(sys.argv)
bus = dbus.SessionBus()
dbus_object = bus.get_object(DBUS_BUSNAME, DBUS_PATH)
dbus_iface = dbus.Interface(dbus_object, DBUS_IFACE)
repeat_list_names()
Qt.QTimer.singleShot(1000, kill_daemon)
app.exec_()
_______________________________________________
PyQt mailing list [email protected]
http://www.riverbankcomputing.com/mailman/listinfo/pyqt