David Bolen <db3l@...> writes:
> Thomas Heller [mailto:theller@...] writes:
>
>> Can you please upload the example as zip-file somewhere the the bug
>> tracker? Either Python (for modulefinder) or py2exe. I promise to look
>> into it.
>
> Crud - while packaging for the bug report I found a bug in my
> simplified version (misnamed module), so that my message as written
> probably doesn't fail for anyone else. It still fails consistently
> when using twisted, but I spent an hour or two trying to work my way
> through the twisted base to again attempt a simpler example to no
> effect yet. (twisted's imports remind me of Adventure's "a maze of
> twisty little passages, all alike"). I'm guessing it's related to
> recursive imports somewhere along the line, since a lot of that
> happens in the Twisted core due to inter-dependencies between
> sub-packages.
>
> I don't suppose you have a copy of twisted (either 1.3.0 or 2.x seem
> the same) on any system do you? If so, then replacing the "from a.c
> import resource" with "from twisted.web import resource" in a's
> __init__ should show the problem. If not, I'll keep digging to see
> if I can create a simplified use case of some sort.
David,
I have tried to build the a.c package as you described, and installed
twisted 1.3.0 for Python 2.4.1. Still, the main.exe file builds fine.
Here are the last lines of the py2exe output:
The following modules appear to be missing
['Crypto.Cipher', 'FCNTL', 'OpenSSL', 'jarray', 'java.io.IOException',
'java.io.InterruptedIOException', 'java.net', 'resource']
The missing 'resource' module may be related to the error that YOU get,
but basically it is correct. It refers to these lines in
twisted\internet\process.py file, near line 409:
try:
import resource
maxfds = resource.getrlimit(resource.RLIMIT_NOFILE)[1] + 1
# OS-X reports 9223372036854775808. That's a lot of fds to close
if maxfds > 1024:
maxfds = 1024
> Also, for what it's worth, py2app under OS X doesn't exhibit the same
> problem. I know it uses a modified version of modulefinder
> (modulegraph) so it would seem like some of those modifications
> resolved whatever is happening under the covers here. Not sure if
> you've ever considered trying modulegraph in a subsequent release of
> py2exe or not?
The resource module that is imported here is the top-level stdlib
resource module, which is only available in Unix (and OSX, I assume).
So it may be that Unix and OSX doen't have this problem because the
builtin resource module is found, or it may be that py2app's modulegraph
works better than modulefinder.
Still, I would really like you to post a reproducible testcase for
Windows, because I HAVE seen cases where to many careless imports fail
in the py2exe'd app. I'm willing to install even other packages, if it
is required ;-)
Thomas
|