Skip to content

wx.FileDialog regression in 4.2.5 #2860

@benjie-git

Description

@benjie-git

Operating system: MacOS 15.7.3
wxPython version & source: 4.2.5 via pip
Python version & source: 3.12.12 via homebrew

Description of the problem:

Using a FileDialog with style=wx.FD_SAVE in wxPython 4.2.5 gives me the following new error:

wx._core.wxAssertionError: C++ assertion "nIndex < m_nCount" failed at /private/var/folders/yz/zr09txvs5dn18vt4cn21kzl40000gn/T/cibw-sdist-7joaqt40/wxpython-4.2.5/ext/wxWidgets/include/wx/arrstr.h(227) in Item(): wxArrayString: index out of bounds

This works correctly in wxPython 4.2.4.

Minimal sample code to reproduce the bug:

import wx

app = wx.App()
dlg = wx.FileDialog(None, "Export file to...", style=wx.FD_SAVE)
if dlg.ShowModal() == wx.ID_OK:
    print(dlg.GetPath())

Metadata

Metadata

Assignees

No one assigned

    Labels

    wxWidgets-trackedwxWidgets defect with associated ticket

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions