[Twisted-Python] Can't quit a Tkinter application on MacOS X when using Twisted; fix? workaround?

Russell E. Owen rowen at u.washington.edu
Tue Apr 7 15:20:50 EDT 2009

I am trying to convert a cross-platform Python/Tkinter application to 
use Twisted and have run into a problem: at least on MacOS X I can no 
longer quit the application.

I have appended a minimal script showing the problem.

This is probably not an issue on unix and WIndows because I find I have 
to add my own Quit menu item anyway, so I can make it do what I like. 
But on MacOS X with Aqua Tcl/Tk that item is added by the system and its 
meaning appears to be hard-wired -- I suspect to it calls "quit" on Tk's 
mainloop, but I don't know.

Any suggestion for a workaround would be most appreciated. Also if this 
is not a known issue I will file a bug report.

-- Russell

"""Script showing failure-to-quit bug
At least on MacOS XO 10.5.6 with twisted 8.2.0, python 2.5.2 (from 
python.org) and Aqua Tck/Tk 8.4.19 the File>Quit menu has no effect and 
typing ctrl-Q causes the menu to briefly highlight (as usual) but has no 
other effect.
import Tkinter
import twisted.internet.tksupport

root = Tkinter.Tk()
reactor = twisted.internet.reactor


More information about the Twisted-Python mailing list