Commits

Ronald Oussoren committed da8a05a

Workaround for a crash when building a bundle that includes
a python package that has a zipfile in its package directory.

The fix to py2app.build_app is rather crude, and as the
comment says it needs to be fixed in modulegraph.zipio instead.
That requires an API change and that in turn requires a review
of all current uses of that API.

Also remove a debug statement.

Comments (0)

Files changed (3)

doc/changelog.rst

 
 Bugfixes:
 
+- py2app failed to build the bundle when python package contained
+  a zipfile with data.
+
+  This version solves most of that problem using a rough
+  workaround (the issue is fixed when the filename ends with '.zip').
+
 - The code that recreates the stub executables when they are
   older than the source code now uses ``xcode-select`` to 
   find the root of SDKs.

py2app/build_app.py

                 pth = os.path.join(dname, fname)
 
                 # Check if we have found a package, exclude those
-                if zipio.isdir(pth):
+                if zipio.isdir(pth) and not pth.endswith('.zip'):
+                    # XXX: the 'and not' part is wrong, need to fix zipio.isdir
                     for p in zipio.listdir(pth):
                         if p.startswith('__init__.') and p[8:] in exts:
                             break
                         fp_in.close()
                         fp_out.close()
 
-                        print "XXX byte-compiling fn=%s cfile=%s dfile=%s"%(fn, cfile, dfile)
                         compile(fn, cfile, dfile)
                         os.unlink(fn)