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

Silent crash when passing a pathlib.Path object as dir to QFileDialog.getSaveFileName() using keyword arguments

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2: Important
    • 6.10.0, 6.9.2
    • 6.9.0
    • PySide
    • None
    • Python 3.12.4
      Qt 6.9.0 (x86_64-little_endian-llp64 shared (dynamic) release build; by MSVC 2022) [Python limited API 3.12.4]
    • Windows
    • 79f2cd78f (dev), 4cd4c5214 (6.9)

    Description

      The program silently crashes without error if the `dir` argument of `QFileDialog.getSaveFileName` is of type `pathlib.Path`.

      The string representation of the path works fine.

      I would've expected an exception for incompatible type, since silent crashes are very hard to debug.
      Forgetting to convert the Path to str is something that has happened to me rather often, and it may happen to other people as well. So I believe that throwing an exception here would benefit several people.

      Attachments

        For Gerrit Dashboard: PYSIDE-3133
        # Subject Branch Project Status CR V

        Activity

          People

            kleint Friedemann Kleint
            exxec Raphael Kriegl
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes