logo       

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

python.apple

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


On 14 May 2004, at 01:29, Russell E. Owen wrote:

In article <rowen-C76C8E.09571605052004@xxxxxxxxxxxxx>,
"Russell E. Owen" <rowen@xxxxxxxxxxx> wrote:

I am having trouble with some ftp code. On some platforms it works fine
and on others it reliably hangs....(including MacOS X command-line
it works, but a bundled app version of the identical code fails)

After some experimentation, I found the hanging was occurring in ftplib.
It delays importing re and compiling two regular expressions until they
are needed, and the thread hangs both on the import and (if I modify
ftplib to import re in advance) on the compilation. Modifying ftplib to
do both jobs in advance (when first imported) fixes the problem.

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).

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?

Also, there are now quite a few things called bundlebuilder or variations
on it. Which one are you using? With what options?
--
Jack Jansen, <Jack.Jansen@xxxxxx>, http://www.cwi.nl/~jack
If I can't dance I don't want to be part of your revolution -- Emma Goldman


_______________________________________________
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