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

QWebsocket.open sends extra bytes and fails if a ping is pending

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Out of scope
    • Icon: Not Evaluated Not Evaluated
    • None
    • 6.6.2
    • PySide
    • None
    • Linux/X11

      A call to QWebsocket.open(QUrl(url)) will only start to "do something" when the control is given back to the event loop. When my code includes a line with a call to QWebsocket.ping() before the control is given back to the event loop, then the first line of the first request to the websocket server will not be 'GET / HTTP/1.1' as it should be, but b'\x89\x80\xf2\xb8\xa9\xb2GET / HTTP/1.1'. This causes a response "400 Bad Request" by at least Python websocket servers and no connection can be established.

      The documentation does not say anything about this behavior. It does not even say that open() is non-blocking.

      This problem affects bot PySide6 and PyQt6, so maybe the Bug is in Qt, but I am unable to find the relevant piece of code.

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

            crmaurei Cristian Maureira-Fredes
            rgrellmann Robert Grellmann
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes