ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> py2exe-users
py2exe-users
[Py2exe-users] Python 2.5 and zlib.pyd missing
by Carlos Eduardo other posts by this author
Sep 19 2006 3:10PM messages near this date
Re: [Py2exe-users] Need a bit of TKinter help... | Re: [Py2exe-users] Python 2.5 and zlib.pyd missing
Looks like that Python 2.5 has the zlib module built in, crashing Py2exe when
"Compressed" = 1.

I changed a little(commented) the build_exe.py script and it worked perfectly
for me. Any drawbacks in the change i made?

Here follows the part I commented:

--- Line 572
        if dist.zipfile is None:
            os.unlink(arcname)
        else:
            if self.bundle_files < 3 or self.compressed:
                arcbytes = open(arcname, "rb").read()
                arcfile = open(arcname, "wb")

                if self.bundle_files < 2: # bundle pythonxy.dll also
                    print "Adding %s to %s" % (python_dll, arcname)
                    arcfile.write("<pythondll> ")
                    bytes = open(os.path.join(self.bundle_dir, python_dll),
"rb").read()
                    arcfile.write(struct.pack("i", len(bytes)))
                    arcfile.write(bytes) # python dll
                ''' --->  Start comment so py2exe doesnt search for zlib.pyd
                if self.compressed:
                    # prepend zlib.pyd also
                    print "Adding zlib%s.pyd to %s" % (is_debug_build and "_d"
or "", arcname)
                    arcfile.write("<zlib.pyd> ")
                    zlib_file = imp.find_module("zlib")
                    bytes = zlib_file.read()
                    arcfile.write(struct.pack("i", len(bytes)))
                    arcfile.write(bytes) # zlib.pyd
                ''' 
                arcfile.write(arcbytes)
--- Line 596

Waiting for feedback,

Carlos



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Py2exe-users mailing list
Py2exe-users@[...].net
https://lists.sourceforge.net/lists/listinfo/py2exe-users
Thread:
Carlos Eduardo
Don Quijote
Jimmy Retzlaff
Thomas Heller

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved