logo       

Re: Re: urllib and ftplib hang in bundle but not when run directly: msg#00096

python.apple

Subject: Re: Re: urllib and ftplib hang in bundle but not when run directly

At 11:14 PM +0200 2004-05-15, Jack Jansen wrote:
...
My gut feeling is that it's not the import lock that is the problem: something
as fundamental as the import lock being in a different state in a bundlebuilder
application (as compared to a normal script run) would have show up much
sooner. I did a quick test and it seems the import lock isn't held, indeed (in an
application created with the stock 2.3 bundlebuilder).

I agree, especially as simply compiling the regular expression can cause the same problem.

My next guess would be that the bundled application somehow holds
a lock that is internal to re, but a quick look at re (and _sre) revealed no
such lock, especially given your assertion that things go wrong at import
time. Also, I can't imagine why a bundlebuilder app would hold such
a lock while a normal script wouldn't.

Still, I'd like to debug this, as errors such as this are really nasty.
Could you try to attach gdb to the process as it is hanging, and see whether
you can find out what lock (if any) you are hanging on?

I'll gladly have a go at that. not having used gdb before I'm wondering if anyone can suggest a tutorial or recipe.

Also, there are now quite a few things called bundlebuilder or variations
on it. Which one are you using? With what options?

I am using the bundlebuilder that came with Panther's built-in Mac Python 2.3. Here's the basic call (the build script has additional code to handle the fact that I mix some data files, e.g. sounds and html help, in with my modules, but this just copies files into the bundle):

inclPkgs = ["RO", "TUI"]
libs = [
"/Library/Frameworks/Tcl.framework",
"/Library/Frameworks/Tk.framework",
]
resources = [tuiDir]
bundlebuilder.buildapp(
name = appName, # application name
builddir = ".", # dir for application
mainprogram = mainProg, # your app's main()
argv_emulation = False, # drag&dropped filenames show up in sys.argv?
iconfile = 'TUI.icns', # file containing your app's icons
semi_standalone = True, # make this app self contained.
includePackages = inclPkgs, # additional Packages to force in
libs = libs, # extra libraries to force in
resources = resources, # extra files or folders to copy to Resources
)


Note that this same code also hangs under RedHat 9.2 linux with Python 2.3.3. Still, the fact that it runs fine as a pythonw command-line app (with GUI) and not as a bundled app is certainly suspicious and if gdb will show what's going on, that'll be great! I'd sure rather not hack my own version of ftplib.

-- Russell

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



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise