[Pythonmac-SIG] Possible bug in setuptools/py2app

jens.thomas at stfc.ac.uk jens.thomas at stfc.ac.uk
Tue May 25 18:43:15 CEST 2010


Hi,

I've hit a problem trying to package up an application using py2app (this is on OSX 10.6). This is using the latest version of py2app as installed with easy_install.

My setup.py file lives in the top-level directory of the project directory (i.e. it's in the same directory as the python code for the project, which I think is a valid place for it to live).

When I try and package it up with py2app, the packaging fails because the paths to the data files that py2app looks for have the first character of their path lopped off and py2app crashes out as shown below:

running py2app
running build_py
creating build/bdist.macosx-10.6-universal/lib/ccp1gui/oc
error: can't copy 'oc/ccp1gui.zme.txt': doesn't exist or not a regular file


The correct path should be: "doc/ccp1gui.zme.txt"

I've managed to trace the problem to the file:

/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/setuptools/command/build_py.py

specifically the function _get_data_files, where there is the code:

# Length of path to strip from found files
plen = len(src_dir)+1

In my case,  src_dir is blank for the first package directory (I think because it's the same one as the one in which setup.py is running from), which is why it chops off the first character.

Is this a bug?

Many thanks,

Jens
-- 
Scanned by iCritical.


More information about the Pythonmac-SIG mailing list