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

_______________________________________________
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig

Reply via email to