[PyQt] Issue: PyQt5 can only connect to one D-Bus service, not two.

David Roberts ddr at krontech.ca
Fri Oct 5 02:41:15 BST 2018


Hello. I'm pretty sure this is a bug, but I'm having trouble connecting to
two D-Bus services at once. The second connection connects to the first
service, although it claims to be correctly connected to the second service.

I have detailed my findings on StackOverflow in the form of a question. <
https://stackoverflow.com/questions/52657066/pyqt5-how-to-connect-to-two-d-bus-services-at-once>.
I will, however, attach the minimal reproduction case here as well.

In a nutshell, both result1 and result2 are the same after running the
following code:

    provider1API = QDBusInterface('com.krontech.chronos.control.mock', '/',
'',
        QDBusConnection.systemBus() )
    provider2API = QDBusInterface('com.krontech.chronos.video.mock', '/',
'',
        QDBusConnection.systemBus() )

    result1 = QDBusReply(provider1API.call('exampleCall')).value()
    result2 = QDBusReply(provider2API.call('exampleCall')).value()

result1 and result2 should be different, since they are connecting to two
different D-Bus interfaces which return two different results.

I am using Python 3.7, PyQt 5.11.2, and Qt 5.11.1 on Debian 7.

Thank you,
–DDR

(Note: To enable D-Bus, you may need a D-Bus policy file. I have attached
an example one, com.krontech.chronos.conf, but if you're not running Python
as root you will need to change the username in it. The policy file goes in
/etc/dbus-1/system.d/.)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20181004/d9940770/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: com.krontech.chronos.conf
Type: application/octet-stream
Size: 1522 bytes
Desc: not available
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20181004/d9940770/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: repro.py
Type: text/x-python
Size: 1537 bytes
Desc: not available
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20181004/d9940770/attachment-0001.py>


More information about the PyQt mailing list