The attached patch is a first start at working around the crash. With this patch I can use Tk without a crash:
>>> import Tkinter
>>> Tkinter.Tk()
Sun May 16 12:11:08 Rivendell.local python.exe[55984] <Error>: kCGErrorFailure: Set a breakpoint @ CGErrorBreakpoint() to catch errors as they are logged.
_RegisterApplication(), FAILED TO establish the default connection to the WindowServer, _CGSDefaultConnection() is NULL.
<Tkinter.Tk instance at 0x100592d88>
>>> 2010-05-16 12:11:08.771 python.exe[55984:903] setCanCycle: is deprecated. Please use setCollectionBehavior instead
Unexpected Objective-C exception in Tk
>>>
This isn't ideal though, especially because the patch requires that you build using an SDK or explicitly specify a deployment target (MACOSX_DEPLOYMENT_TARGET=10.5) during build.
Another reason to dislike this: the errors are swallowed instead of propagated to Python code.
I haven't checked yet if this patch allows you to run the tests without crashing. |