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

QDir.Filter not working on Python 3.11

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P3: Somewhat important
    • 6.8.0, 6.7.3
    • 6.7.1
    • PySide
    • None
    • Windows 11, pyside 6.7.2, python 3.11.9
    • Windows
    • 1e2729ccd (6.7)

    Description

      This code works fine on python 3.10:

      d = QDir(base_path)
      entries = d.entryList(QDir.Filter.Files)

       

      However, doesn't work on 3.11 (<3.10 or >3.11 not tested at this point).  Always returns an empty list.

      The workaround at the moment is to not have the filter, which returns all entries, including directories.

      files = d.entryList()

      Notes:

      • This was tested with both resource paths (ex ":/images") and normal paths.
      • Any filter causes QDir.entryList(...) to return an empty list (ex. QDir.Filter.Dirs)

      Attachments

        1. pyside2834_cpp.zip
          1 kB
        2. pyside2834.zip
          2 kB
        3. qdir_entrylist.py
          0.6 kB
        4. resources_rc.py
          1 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            kleint Friedemann Kleint
            joaonc Joao Coelho
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes