Skip to content Skip to sidebar Skip to footer

How Do I Disable PythonWin's “Redirecting Output To Win32trace Remote Collector” Feature Without Uninstalling PythonWin?

When I run a wxPython application, it prints the string “Redirecting output to win32trace remote collector”and I must open PythonWin's trace collector tool to view that trace o

Solution 1:

You can even pass that when you instantiate your wx.App():

if __name__ == "__main__":
    app = wx.App(redirect=False) #or 0
    app.MainLoop()

wxPython wx.App docs


Solution 2:

This message deceived me into thinking win32trace was preventing me from seeing uncaught exceptions in the regular console (of my IDE). The real issue was that wxPython by default redirects stdout/stderr to a popup window that quickly disappeared after an uncaught exception. To solve that problem, I simply had to pass

redirect=0
to the superclass constructor of my application.
class MyApp(wx.App):
    def __init__(self):
        # Prevent wxPython from redirecting stdout/stderr:
        super(MyApp, self).__init__(redirect=0)

That fix notwithstanding, I am still curious about how to control win32trace.


Post a Comment for "How Do I Disable PythonWin's “Redirecting Output To Win32trace Remote Collector” Feature Without Uninstalling PythonWin?"