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

method writeRawData of QDataStream do not accept bytes as parameter

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P4: Low
    • 6.6.0
    • 6.5.2
    • Type hints
    • None
    • Linux/X11
    • 940cad174 (dev), a50b5f9d7 (dev), 0ad1b4262 (6.6)

    Description

      Python 3.11.4 | packaged by conda-forge | (main, Jun 10 2023, 18:08:17) [GCC 12.2.0] on linux
      Type "help", "copyright", "credits" or "license" for more information.
      >>> from PySide6.QtCore import QByteArray, QIODevice, QDataStream
      >>> buffer = QByteArray(1000, 0)
      >>> buffer.resize(0)
      >>> ds = QDataStream(buffer, QIODevice.WriteOnly)
      >>> b = b'test'
      >>> type(b)
      <class 'bytes'>
      >>> ds.writeRawData(b)
      Traceback (most recent call last):
       File "<stdin>", line 1, in <module>
      ValueError: 'PySide6.QtCore.QDataStream.writeRawData' called with wrong argument values:
       PySide6.QtCore.QDataStream.writeRawData(b'test',)
      Found signature:
       PySide6.QtCore.QDataStream.writeRawData(bytes)

      Although the argument of writeRawData actually is <class 'bytes'>, it produces this odd error.

      Attachments

        For Gerrit Dashboard: PYSIDE-2442
        # Subject Branch Project Status CR V

        Activity

          People

            kleint Friedemann Kleint
            ivannaz Ivan Nazarenko
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes