Details
Description
PySide6.QtDBus.QDBusVariant.variant() call crashes Python, I think because it returns QVariant which does not exist as datatype:
It should return a native type, but it simply crashes...
Here is the code:
service = "org.mpris.MediaPlayer2.spotifyd.instance896" path = "/org/mpris/MediaPlayer2" iface = "org.mpris.MediaPlayer2.Player" ifaceprops = "org.freedesktop.DBus.Properties" smp = QtDBus.QDBusInterface(service, path, interface=ifaceprops, connection=QtDBus.QDBusConnection.systemBus()) msg = smp.call("Get", iface, "Volume") result1 = msg.arguments()[0] v1 = result1.variant()
QDBus_DEBUG output looks ok:
QDBusConnectionPrivate(0x7f8400ed00) sending message: QDBusMessage(type=MethodCall, service="org.mpris.MediaPlayer2.spotifyd.instance896", path="/org/mpris/MediaPlayer2", interface="org.freedesktop.DBus.Properties", member="Get", signature="", contents=("org.mpris.MediaPlayer2.Player", "Volume") ) QDBusConnectionPrivate(0x7f8400ed00) got message reply: QDBusMessage(type=MethodReturn, service=":1.111", signature="v", contents=([Variant(double): 34]) )
Attachments
For Gerrit Dashboard: PYSIDE-2544 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
524275,2 | Fix a crash accessing QDBusVariant.variant() | 6.6 | pyside/pyside-setup | Status: MERGED | +2 | 0 |
524290,2 | Fix a crash accessing QDBusVariant.variant() | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
524480,2 | Fix a crash accessing QDBusVariant.variant() | tqtc/lts-6.5 | pyside/tqtc-pyside-setup | Status: MERGED | +2 | 0 |