Phoenix
Phoenix copied to clipboard
Save-file dialog doesn't show complete file list view if `defaultFile` contains wildcards.
Operating system: Windows 10 wxPython version & source: wxPython 4.2.0 (pypi) Python version & source: 3.10.4
Description of the problem:
The file list view of wx.FileDialog is incomplete if the argument defaultFile contains ~~OS invalid characters such as~~ wildcard *.
Code Example (click to expand)
import wx
def saveas(self, name):
with wx.FileDialog(self, "Save buffer as",
defaultFile=name,
style=wx.FD_SAVE|wx.FD_OVERWRITE_PROMPT) as dlg:
if dlg.ShowModal() != wx.ID_OK:
return
if __name__ == "__main__":
app = wx.App()
saveas(None, name="*scratch*") # [ NG ] OS-invalid name => Actual outcome
## saveas(None, name="_scratch_") # [ OK ] valid name => Expected outcome
Actual outcome:
Although the file list shows 4 files, there are actually more than 10 files in this directory.

Expected outcome:

I noticed that presetting defaultFile acts as Unix shell-style wildcards.
However, even if I change [File name:] text, the filename filter still works and the file list view remains incomplete.
I wonder if this is a specification?