Uploaded image for project: 'Qt for Python'
  1. Qt for Python
  2. PYSIDE-2544

PySide6.QtDBus.QDBusVariant.variant() crashes Python

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P1: Critical
    • 6.5.4, 6.6.2, 6.7.0
    • 6.6.0
    • PySide
    • None
    • Raspberry Pi 4 with current Raspberry Pi OS
    • Linux/Wayland, Linux/X11
    • fd5916f44 (dev), 3ed9edc1a (6.6), fc83b59d6 (tqtc/lts-6.5)

    Description

      PySide6.QtDBus.QDBusVariant.variant() call crashes Python, I think because it returns QVariant which does not exist as datatype:

      https://wiki.qt.io/Differences_Between_PySide_and_PyQt#PySide_only_supports_PyQt's_%22API_2%22_(PSEP_101)

      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

        1. pyside2544_stack.txt
          35 kB
        2. pyside2544_valgrind.txt
          3 kB
        3. qdbusdemo.py
          1 kB
        For Gerrit Dashboard: PYSIDE-2544
        # Subject Branch Project Status CR V

        Activity

          People

            kleint Friedemann Kleint
            drexel M N
            M N M N
            M N M N
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes