<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Hi,</div><div><br></div>A while back on Oct 13, 2010, at 7:20 PM, James Y Knight wrote:<div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: 'Eames Century Modern'; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; ">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]<br><br>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().<br></span></blockquote></div><br><div>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&nbsp;<span class="Apple-style-span" style="font-family: Helvetica; font-size: 14px; "><b>USING_FORK_WITHOUT_EXEC_IS_NOT_SUPPORTED_BY_FILE_MANAGER)&nbsp;</b></span>. Both machines run the same versions of python, pyobjc, twisted. &nbsp;Some digging showed that on the mini twisted.application.reactors imports zope.interface, which in turn runs this:</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>__import__('pkg_resources').declare_namespace(__name__)</div><div>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.</div><div><br></div><div>Could this be related to <a href="http://twistedmatrix.com/trac/ticket/4644">http://twistedmatrix.com/trac/ticket/4644</a> ?</div><div>Any clues to why&nbsp;pkg_resources would cause Carbon to load on one machine, but not on another?</div><div>Any clues to prevent it these modules from loading?</div><div><br></div><div>Local:</div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 174.9px; text-indent: -174.9px; font: normal normal normal 11px/normal 'Lucida Grande'; ">&nbsp;&nbsp;System Version:<span class="Apple-tab-span" style="white-space:pre">        </span>Mac OS X 10.6.4 (10F569)</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 174.9px; text-indent: -174.9px; font: normal normal normal 11px/normal 'Lucida Grande'; ">&nbsp; Kernel Version:<span class="Apple-tab-span" style="white-space:pre">        </span>Darwin 10.4.0</div></div><div><br></div><div>Remote:</div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 174.9px; text-indent: -174.9px; font: normal normal normal 11px/normal 'Lucida Grande'; ">&nbsp;System Version:<span class="Apple-tab-span" style="white-space:pre">        </span>Mac OS X Server 10.6.4 (10F569)</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 174.9px; text-indent: -174.9px; font: normal normal normal 11px/normal 'Lucida Grande'; ">&nbsp;&nbsp;Kernel Version:<span class="Apple-tab-span" style="white-space:pre">        </span>Darwin 10.4.0</div></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 174.9px; text-indent: -174.9px; font: normal normal normal 11px/normal 'Lucida Grande'; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 174.9px; text-indent: -174.9px; font: normal normal normal 11px/normal 'Lucida Grande'; ">Thanks,</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 174.9px; text-indent: -174.9px; font: normal normal normal 11px/normal 'Lucida Grande'; ">Erik</div></body></html>