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

Passing invalid keyword arguments to QWaitCondition.wait causes indefinite hang

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.15.0
    • PySide
    • None
    • First found on Manjaro ARM (aarch64), reproduced on Debian AMD64 in both cases using PySide 5.15.0 (latest final release at time of reporting)

    • All

    Description

      If a keyword argument is passed to `QWaitCondition.wait` (even one I would expect to be valid) rather than raising `TypeError` as I would expect, it just pauses indefinitely.

      It does not wake up for a `wakeAll` event. It does not cause an exception. It does not timeout like I would expect when passed the proper argument `time` (or `msecs`, which is what pyqt calls the variable... tried that too just in case)

      When passed as positional arguments, it works as expected, but there is no communication that the arguments are intended to be positional only.

      ```
      >>> from PySide2.QtCore import QWaitCondition, QMutex
      >>> import PySide2
      >>> PySide2._version_
      '5.15.0'
      >>> m = QMutex()
      >>> c = QWaitCondition()
      >>> m.lock()
      >>> c.wait(m, 1000) # works as expected, returns after 1 second
      False
      >>> c.wait(m, time=1000) # hangs indefinitely, despite name matching argument name
      >>> c.wait(m, clearly_fake_kwarg=1000) # hangs indefinitely, would expect TypeError
      ```

      Attachments

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

        Activity

          People

            crmaurei Cristian Maureira-Fredes
            ksunden Kyle Sunden
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes