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

PySide6.QtNetwork.QLocalSocket.writeData argument check error

    XMLWordPrintable

Details

    • Bug
    • Resolution: Incomplete
    • P3: Somewhat important
    • None
    • 6.4.1
    • PySide
    • None
    • Linux/Wayland

    Description

      ValueError: 'PySide6.QtNetwork.QLocalSocket.writeData' called with wrong argument values:
      PySide6.QtNetwork.QLocalSocket.writeData(b'\x04dm\x01', 4)
      Found signature:
      PySide6.QtNetwork.QLocalSocket.writeData(bytes, int)

      my code can work with pyqt6, but it fails with pyside6

      – python code –

      # from PySide6.QtCore import (
      from PyQt6.QtCore import (
        QIODeviceBase
      )
      
      # from PySide6.QtNetwork import (
      from PyQt6.QtNetwork import (
        QLocalSocket
      )
      
      class uInputSock(QLocalSocket):
      	def __init__(self, name:str):
      		super(uInputSock, self).__init__()
      		self.setServerName(name)
      		print("serverAddress:", self.serverName())
      
      	def sendBytes(self, packet:bytes) -> int:
      		if (not self.isOpen()):
      			print(self.sendBytes.__name__, "try to connect server")
      
      			self.connectToServer(QIODeviceBase.OpenModeFlag.ReadWrite)
      			if (not self.waitForConnected(500)):
      				print("%d:%s"%(self.error(), self.errorString()))
      				return -1
      
      		print('uInputSock::sendBytes()', type(packet), len(packet), packet)
      
      		# writeData
      		# PySide6
      		# return self.writeData(packet, len(packet))
      		
      		# PyQt6
      		return self.writeData(packet)
      

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            crmaurei Cristian Maureira-Fredes
            hoyeon.jang Hoyeon JANG
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes