Seeking suggestions: Linux-specific wxpython problems

I’m having GUI problems with a large open-source application that runs fine on Windows and Mac, and historically has been fine on Linux, but now fails with several – but not all – Python interpreters on Linux. The failure mode is that when accessing some wx.TextCtrl widgets that trigger MPL graphics, the GUI gets “stuck” and in some cases will print a message:

object address : 0x7f2d866dc6a0
object refcount : 2
object type : 0x7f2e1727d640
object type name: RecursionError
object repr :
lost sys.stderr

I don’t know where this error is coming from – not from my app.

A short video clip showing what happens is in a GitHub issue. On Ubuntu 22, I see problems with conda-forge based Python (with wxpython from conda or from pip), but the app runs fine if I use Ubuntu’s Python interpreter and their wxpython. On RHEL 7.9 & 9.x, I have not been able to find a Python that works, and I’ve tried a bunch of options, including Python from conda forge and Redhat and wxpython from conda forge, Redhat and PyPi (pip).

I’m really at a loss for where to go on this and any advice would be welcomed.

Have you tried running the Widget Inspection Tool with your application?

Edit:
The current version has more options than is shown in the Wiki article, including the ability to show which events are being triggered:

The issue might be somewhere in Python:

Impossible to say what triggers it - I don’t use Linux and your application is way too large to even understand where to find those textctrls and what callback they trigger.

Is the Python version the same in all installations?

@RichardT: Did not know that WIT traces events. That is very likely to be helpful.

@Andrea_Gavana: Nice find. Good to know that this error is coming from the Python core and under what sort of conditions. FWIW, the nearly identical code (there is a small amount of platform-specific code, but nothing related to this.) It runs fine on all platforms except Linux (conditional on the Python dist).

With hundreds, if not thousands, of users for this application, I tend to hear about things that are broken quickly. Grad students seem to expect the same level of response from free software as they do from things that cost real money.

I have tracked down that the problem is coming from my customized wx.TextCtrl class. If I use the standard class the problem goes away (but so does much needed functionality). At least now I know what needs to be debugged. WIT should allow me to see what events are events are being issued. Many, many thanks.

well, a recursion on text control usually arises from using SetValue instead of ChangeValue in a text handler :face_with_raised_eyebrow: