joaonc / show_dialog

Easily show a dialog for miscellaneous uses.
https://joaonc.github.io/show_dialog
MIT License
0 stars 0 forks source link

`QDir` filter files not working on python 3.11 #16

Open joaonc opened 1 month ago

joaonc commented 1 month ago

This code

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

works fine on python 3.10.

However, doesn't work on 3.11 (<3.10 or >3.11 not tested at this point). The workaround at the moment is to not have the filter, which returns all entries, including directories.

files = d.entryList()

Note: this was tested with resource paths (ex :/stylesheets).

joaonc commented 1 month ago

This code is used in src.show_dialog.utils_qt::list_resources(...) and there are unit tests for it.

joaonc commented 1 month ago

It appears that any filter QDir.Filter.* doesn't work on python 3.11.

joaonc commented 1 month ago

Created ticket in Qt: https://bugreports.qt.io/browse/PYSIDE-2834

joaonc commented 1 month ago

Looks like it has been fixed and will be in the next version of pyside6 (currently using 6.7.2).