[Pythonmac-SIG] trouble making a standalone app with Python 2.4
Bob Ippolito
bob at redivi.com
Wed Feb 23 18:15:23 CET 2005
On Feb 23, 2005, at 11:30 AM, Kevin Dangoor wrote:
> Bob Ippolito wrote:
>
>> I probably won't be able to look at this until tomorrow, but try
>> comparing sys.modules.keys() between your environment with py2app -A
>> and py2app.
>
> in getRunLoop, I added print sys.modules.keys() and then ran the Web
> Services Tool with and without -A.
>
> Without -A (normal standalone app), the following had been imported.
> They were not imported with -A:
> 'AppKit.imp',
> 'AppKit.os',
> 'AppKit.sys',
> 'Foundation.imp',
> 'objc.imp',
> 'objc.sys',
> 'twisted.internet.imp',
> 'twisted.protocols.cStringIO',
> 'twisted.protocols.imp',
> 'twisted.protocols.os',
> 'zlib',
> 'zope.interface.imp',
> 'zope.interface.os',
>
> I'm guessing that the "imp"s here are probably something special and
> automatic that py2app does.
Looks more like a "special and automatic" bug to me ;) It's probably
something I inherited from looking at py2exe's source. I plan on
rewriting the way that the module system works as soon as the Python
Egg runtime is farther along.
> Probably more relevant is the list of things that were imported with
> -A, but not without:
> 'Carbon.CF',
> 'Carbon._CF',
> '_CF',
>
> Seeing this, I added an explicit import for these in one of my
> modules. And it worked! Your intuition about the WebKit problem may
> have been on track. Just as with that case, these imports were
> ultimately getting called from within a block. Putting them at the
> module level fixed it.
>
> Thanks for the suggestion of looking at sys.modules! I don't think
> that I was an avenue I would have gone down.
I'll try and remember to patch Twisted so that this won't happen when I
get the chance..
-bob
More information about the Pythonmac-SIG
mailing list