On 21 Nov, 2011, at 7:08, Robert Klep wrote:
> Hey all,
> I'm running into a strange problem with PyObjC-based apps.
> The situation: I'm working on a .mailbundle (a plug-in for Apple Mail). From that plug-in, I want to start a PyObjC-based application. No matter what, this fails: the application gets a SIGSEGV (I'll post some more information below).
> I've used pretty much all methods of starting the application (NSWorkspace, NSTask, even executing "open -a APP" from the Python subprocess module), and it keeps failing. Of course, the app works without problems when started manually. Starting the app from a Python-shell using [NSWorkspace launchApplication:] works, too. Just not from within the plug-in.
If I'd have to guess I'd say that py2app doesn't fully reset the environment and some bits of the environment that py2app sets to communicate with the bundle code leaks into application bundle and causes problems there.
What happens when you add "os.delenv('PYOBJC_BUNDLE_ADDRESS')" before you try to open the bundle?