
Hi, A while back on Oct 13, 2010, at 7:20 PM, James Y Knight wrote:
You need to avoid using or importing any OSX APIs until after the daemonization has occurred. Unfortunately, twisted executes the entire script file before daemonizing. [that's unfortunate for other reasons besides this, too]
Here's a corrected version of your script which works properly. It defers importing Quartz until the reactor is running, by moving it into a function called by reactor.callWhenRunning().
Deferring OSX API's until after daemonisation was the solution. My test script, fixed by James, works on macbook, but when I run it on a remote OSX server mini, it doesn't. It crashes as before with USING_FORK_WITHOUT_EXEC_IS_NOT_SUPPORTED_BY_FILE_MANAGER) . Both machines run the same versions of python, pyobjc, twisted. Some digging showed that on the mini twisted.application.reactors imports zope.interface, which in turn runs this: __import__('pkg_resources').declare_namespace(__name__) and this causes Carbon to be loaded, before daemonisation. I can't defer loading reactor because I need it to make things tick, so I'm stuck. Could this be related to http://twistedmatrix.com/trac/ticket/4644 ? Any clues to why pkg_resources would cause Carbon to load on one machine, but not on another? Any clues to prevent it these modules from loading? Local: System Version: Mac OS X 10.6.4 (10F569) Kernel Version: Darwin 10.4.0 Remote: System Version: Mac OS X Server 10.6.4 (10F569) Kernel Version: Darwin 10.4.0 Thanks, Erik