title: py2app IOError: [Errno 63] File name too long:
body: <p>Im trying to package a PySide app with py2app on OS X 10.6 with python 2.6.</p>
  
  <p>The problem i'm getting it that it seems like py2app is getting stuck in a loop and recursively appending the same directory path onto its self, and then it eventually hits the Python file too long IOError as above. Below is the stack trace I get </p>
  
  <pre><code>     copying /Users/mlakewood/Documents/Programming/DataWrangler/build/bdist.macosx-10.6-universal/python2.6-standalone/app/collect/DataWrangler/build/bdist.macosx-10.6-
  universal/python2.6-standalone/app/collect/DataWrangler/build/bdist.macosx-10.6-
  universal/python2.6-standalone/app/collect/DataWrangler/build/bdist.macosx-10.6-
  universal/python2.6-standalone/app/collect/DataWrangler/build/bdist.macosx-10.6-
  universal/python2.6-standalone/app/collect/DataWrangler/build/bdist.macosx-10.6-
  universal/python2.6-standalone/app/collect/DataWrangler/build/bdist.macosx-10.6-
  universal/python2.6-standalone/app/collect/DataWrangler/build/bdist.macosx-10.6-
  universal/python2.6-standalone/app/collect/DataWrangler/build/bdist.macosx-10.6-
  universal/python2.6-standalone/app/collect/DataWrangler/build/bdist.macosx-10.6-
  universal/python2.6-standalone/app/collect/DataWrangler/build/bdist.macosx-10.6-
  universal/python2.6-standalone/app/collect/_builtinSuites/__init__.pyc -&gt; /Users/mlakewood/Documents/Programming/DataWrangler/build/bdist.macosx-10.6-universal/python2.6-standalone/app/collect/DataWrangler/build/bdist.macosx-10.6-universal/python2.6-standalone/app/collect/DataWrangler/build/bdist.macosx-10.6-universal/python2.6-standalone/app/collect/DataWrangler/build/bdist.macosx-10.6-universal/python2.6-standalone/app/collect/DataWrangler/build/bdist.macosx-10.6-universal/python2.6-standalone/app/collect/DataWrangler/build/bdist.macosx-10.6-universal/python2.6-standalone/app/collect/DataWrangler/build/bdist.macosx-10.6-universal/python2.6-standalone/app/collect/DataWrangler/build/bdist.macosx-10.6-universal/python2.6-standalone/app/collect/DataWrangler/build/bdist.macosx-10.6-universal/python2.6-standalone/app/collect/DataWrangler/build/bdist.macosx-10.6-universal/python2.6-standalone/app/collect/DataWrangler/build/bdist.macosx-10.6-universal/python2.6-standalone/app/collect/DataWrangler/build/bdist.macosx-10.6-universal/python2.6-standalone/app/collect/_builtinSuites
      Traceback (most recent call last):
        File "/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/py2app/build_app.py", line 579, in _run
          self.run_normal()
        File "/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/py2app/build_app.py", line 650, in run_normal
          self.create_binaries(py_files, pkgdirs, extensions, loader_files)
        File "/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/py2app/build_app.py", line 718, in create_binaries
          self.copy_package_data(item, self.collect_dir)
        File "/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/py2app/build_app.py", line 809, in copy_package_data
          copy_tree(pth, os.path.join(target_dir, fname))
        File "/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/py2app/util.py", line 501, in copy_tree
          dry_run=dry_run, condition=condition))
        File "/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/py2app/util.py", line 501, in copy_tree
          dry_run=dry_run, condition=condition))
        File "/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/py2app/util.py", line 501, in copy_tree
          dry_run=dry_run, condition=condition))
  </code></pre>
  
  <p>snip... (lots of lines that are all the same as the one above and below)</p>
  
  <p>unsnip...</p>
  
  <pre><code>File "/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/py2app/util.py", line 501, in copy_tree
      dry_run=dry_run, condition=condition))
    File "/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/py2app/util.py", line 501, in copy_tree
      dry_run=dry_run, condition=condition))
    File "/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/py2app/util.py", line 501, in copy_tree
      dry_run=dry_run, condition=condition))
    File "/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/py2app/util.py", line 504, in copy_tree
      preserve_times, update, dry_run=dry_run)
    File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/distutils/file_util.py", line 165, in copy_file
      _copy_file_contents(src, dst)
    File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/distutils/file_util.py", line 47, in _copy_file_contents
      fdst = open(dst, 'wb')
  IOError: [Errno 63] File name too long: '/Users/mlakewood/Documents/Programming/DataWrangler/build/bdist.macosx-10.6-universal/python2.6-standalone/app/collect/DataWrangler/build/bdist.macosx-10.6-universal/python2.6-standalone/app/collect/DataWrangler/build/bdist.macosx-10.6-universal/python2.6-standalone/app/collect/DataWrangler/build/bdist.macosx-10.6-universal/python2.6-standalone/app/collect/DataWrangler/build/bdist.macosx-10.6-universal/python2.6-standalone/app/collect/DataWrangler/build/bdist.macosx-10.6-universal/python2.6-standalone/app/collect/DataWrangler/build/bdist.macosx-10.6-universal/python2.6-standalone/app/collect/DataWrangler/build/bdist.macosx-10.6-universal/python2.6-standalone/app/collect/DataWrangler/build/bdist.macosx-10.6-universal/python2.6-standalone/app/collect/DataWrangler/build/bdist.macosx-10.6-universal/python2.6-standalone/app/collect/DataWrangler/build/bdist.macosx-10.6-universal/python2.6-standalone/app/collect/DataWrangler/build/bdist.macosx-10.6-universal/python2.6-standalone/app/collect/_builtinSuites/__init__.pyc'
  &gt; /System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/distutils/file_util.py(47)_copy_file_contents()
  -&gt; fdst = open(dst, 'wb')
  </code></pre>
  
  <p>and below is my setup.py file</p>
  
  <pre><code>"""
  This is a setup.py script generated by py2applet
  
  Usage:
      python setup.py py2app
  """
  
  from setuptools import setup
  
  APP = ['gui.py']
  DATA_FILES = []
  OPTIONS = {}
  #OPTIONS = {'argv_emulation': True}
  
  setup(
      app=APP,
      data_files=DATA_FILES,
      options={'py2app': OPTIONS},
      setup_requires=['py2app'],
      includes=['PySide']
  )
  </code></pre>