1

I have a large, multifile, Tkinter app with innumerable functions, that is then being packaged with Pyinstaller as an executable.

It contains error handling for expected events. However, it does not have any error handling for unexpected events. When running the application before packaging it as an executable, unexpected errors are printed to the console. Once it is packaged as an executable, these errors are hidden (I do not want a terminal window to display to the user).

The problem with this is that unexpected errors are not displayed anywhere, and therefore I cannot capture and debug them.

How can I have a "catch-all" that grabs any output that would go to the console, or catch or log any error? I know many ways to do this with extra code throughout, but adding code to each function of the application seems overly burdensome for what I'm trying to achieve.

user1318135
  • 717
  • 2
  • 12
  • 36

1 Answers1

0

There is a solution for Linux systems:

strace -p <PID_OF_PROCESS> -s9999 -e write

It will give you the full output of the already running process.

See:

man strace

For details.

Nikolay B.
  • 21
  • 2