A dbus.mainloop.NativeMainLoop instance is required [Was: Re: dbus-python: support for Windows and OS X]

Simon McVittie simon.mcvittie at collabora.co.uk
Thu Feb 3 04:49:12 PST 2011


On Thu, 03 Feb 2011 at 08:20:08 +0100, Ralf Habacker wrote:
> maybe this is because the Native mainloop implementation in http://cgit.freedesktop.org/dbus/dbus-python/tree/_dbus_bindings/mainloop.c
> is a noop ?

That's deliberate; the GLib and Qt main loop glue modules each provide a
subclass of NativeMainLoop which does something useful. The GLib glue is in
_dbus_glib_bindings in dbus-python, and the Qt glue is provided by PyQt.

My guess would be that your dbus-python and PyQt were compiled differently
(different compilers? different Python versions? ...) in a way that causes
them to be incompatible. PyQt hooks into dbus-python by using a Python module
with a C API (_dbus_bindings), which is relatively unusual; that's why I
suggested trying the GLib main loop, which is compiled alongside dbus-python
itself, so it'd be immune to compiler/version differences.

I do notice that the PyQt website says:

    The DBus support module is installed as dbus.mainloop.qt. [...]
    It is only available for PyQt for X11.

    -- http://www.riverbankcomputing.co.uk/software/pyqt/intro

but perhaps that information is out of date?

I don't develop on Windows, so I'm afraid you're on your own here; I'm somewhat
surprised dbus-python *compiles* on Windows, to be honest.

    Simon


More information about the dbus mailing list