I think I have found a bug in the latest py2exe.

 

If you specify excluded_dlls that do not exist (which is why I am excluding them) then the new isSystemDLL method throws an error because it tries to open the file.

Previously bin_depeneds worked like this:

 

                    if not dll in images \
                       and not dll in dependents \
                       and not os.path.basename(dll).lower() in excluded_dlls \
                       and not isSystemDLL(dll):
                        images.add(dll)
                        if uses_import_module:
                            warnings.add(dll)

 

Which means that isSystemDLL would not be called for excluded dlls.

 

But now it works like this:

 

                    if isSystemDLL(dll):
                        others.add(dll)
                        continue
                    if not dll in images \
                       and not dll in dependents \
                       and not os.path.basename(dll).lower() in excluded_dlls:
                        images.add(dll)
                        if uses_import_module:
                            warnings.add(dll)

 

Which means that the check for excluded happens after the call to isSystemDLL

And then in isSystemDLL, we have this:

 

def isSystemDLL(pathname):
    if os.path.basename(pathname).lower() in ("msvcr71.dll", "msvcr71d.dll"):
        return 0
    if os.path.basename(pathname).lower() in EXCLUDED_DLLS:
        return 1
    # How can we determine whether a dll is a 'SYSTEM DLL'?
    # Is it sufficient to use the Image Load Address?
    import struct
    file = open(pathname, "rb")

 

and the EXCLUDED_DLLS is not the same list as the excluded_dlls option…

 

Thanks,

 

Greg


______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________