The QfileDialog class contains few static methods for fast opening files: https://doc.qt.io/qt-6/qfiledialog.html#static-public-members
Unfortunately, PyQt and PySide backends differ in the naming argument that provides default directory.
In PyQt5/6 it is named directory, when in PySide2/6 it is named dir. PySide follows original Qt convention where PqYt decided to not use the keyword as name of an argument.
Unfortunately, I do not know the method of testing that could find this problem. AS calling this function opened dialogs that hang tests, and with mocking the problem with the signature is not triggered.
Are you open for PR that will introduce cross-compatibility layer.
Something like:
if "dir" in kwargs:
kwargs["directory"] = kwargs.pop("dir")
and vice versa?
inspired by discussion from napari/napari#5834
The
QfileDialogclass contains few static methods for fast opening files: https://doc.qt.io/qt-6/qfiledialog.html#static-public-membersUnfortunately, PyQt and PySide backends differ in the naming argument that provides default directory.
In PyQt5/6 it is named
directory, when in PySide2/6 it is nameddir. PySide follows original Qt convention where PqYt decided to not use the keyword as name of an argument.Unfortunately, I do not know the method of testing that could find this problem. AS calling this function opened dialogs that hang tests, and with mocking the problem with the signature is not triggered.
Are you open for PR that will introduce cross-compatibility layer.
Something like:
and vice versa?
inspired by discussion from napari/napari#5834