1

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 output.

Since I'm not interested in collecting this output, how should I disable this feature?

joeforker
  • 40,459
  • 37
  • 151
  • 246

3 Answers3

2

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

DrBloodmoney
  • 2,786
  • 2
  • 18
  • 17
1

It seems to be an Problem with TortoiseHG. It also happens when using win32gui.GetOpenFileNameW. Uninstalling solves this problem. Unfortunately i found no real solution how to fix this.

  • I also found odrive to cause this same problem (similar SVN functionality). Uninstalling it solved the issue. – DonaldH Jan 20 '17 at 20:31
  • I had the exact same problem with [odrive](https://www.odrive.com), uninstalling it fixed the problem immediately. Weird stuff. – Filip S. Oct 19 '17 at 08:08
1

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.

joeforker
  • 40,459
  • 37
  • 151
  • 246