Debugging tkinter applications
Hi, I'm using Wing Pro 9.1.2.0. When my tkinter application raises an exception, the debug information shows up in the Debug I/O tab, but not the Exceptions tab.
For example:
File "/usr/lib/python3.11/tkinter/__init__.py", line 1702, in configure
return self._configure('configure', cnf, kw)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/tkinter/__init__.py", line 1692, in _configure
self.tk.call(_flatten((self._w, cmd)) + self._options(cnf))
_tkinter.TclError: unknown color name
Is there a way to have the exception above show in the Exceptions tab, so that I can click on it and have it take me to the line with the issue? The Debug I/O tab is shown in plain text, so clicking on the exception won't take me to the line in the editor.
I tried adding TclError to the Exceptions configuration, under 'Always Report', but that didn't make a difference for me. Any ideas? Thanks.
Comments
Do you have the Debugger > Exceptions preference in Wing set to When Printed (Default) or some other value? It's possible Tkinter is printing this in some odd way, and setting a breakpoint on the line where it occurs may allow you to look up the stack and see what it's doing.
Debugger -> Exceptions is set to When Printed (Default). I think I found out what the issue is: I'm using a module called Pygubu (which is used for creating a tkinter GUI using a design editor and loading the .ui file into the project) - something similar to Qt Designer but for tkinter, and that's why it's showing exceptions in the Debug I/O area instead of the Exceptions tab. If I use plain tkinter without Pygubu, the exceptions show up in the Exceptions area.
Thanks for the advice!