wx.GenericDirCtrl runtime error

When I run the demo GenericDirCtrl app, I can reproduce a runtime error with the following steps:

  1. Start the GenericDirCtrl app.
  2. In the right side pane open up drive C to display the folders.
  3. Change all files to python files. The error will popup a window.

My questions are:

  1. Why does this happen and is it a bug?
  2. I’m suspecting the popup window is coming from the run.py file?

I’m getting this same error in my project and I’d like to figure out how to fix it or be able to ignore it. The popup gives me the option to ignore it.

Thank you…

As shown in the dialog the popup is happening because a runtime assertion failed in the C++ code for wxTreeCtrl. Please file a ticket about this at trac.wxwidgets.org, if there isn’t one there already.

I will check and write it up if I don’t find it there already.

In the mean time, how can I add that same Don’t show this error again structure to keep the code running? I checked that box and the code seems to run OK?

You can set how wxPython handles the wxWidgets assertion errors with: wx.App.SetAssertMode.

Be careful with simply suppressing it however, there could be cases where a fatal bug would have been avoided with the dialog or exception. It would probably be better to set it to _LOG and then set the wx.Log target to write to a file. Then you will be more likely to get the information you need to fix problems that may arise.

Ticket created #19182