[Distutils] leading underscores in filenames

John Hunter jdh2358 at gmail.com
Mon Dec 15 21:40:08 CET 2008


I am seeing some strange behavior in files with leading underscores.
I have some python extension code with names like::

  src/_somefile.cpp

and in my sdist they are being added in duplicate, one with the
leading underscore removed.

  src/somefile.cpp
  src/_somefile.cpp

This is causing easy_setup to complain at the end about not being able
to remove certain files.

  jdhunter at bic128:mpl98.5> find . -name backend_agg.cpp
  jdhunter at bic128:mpl98.5> find . -name _backend_agg.cpp
  ./src/_backend_agg.cpp
  jdhunter at bic128:mpl98.5> python setup.py sdist > sdist.out
  jdhunter at bic128:mpl98.5> grep backend_agg.cpp sdist.out
  copying src/_backend_agg.cpp -> matplotlib-0.98.5.1/src
  copying src/backend_agg.cpp -> matplotlib-0.98.5.1/src

When I run easy_install on the src tarball, I then get::

  Installed /home/jdhunter/devez/lib/python2.5/site-packages/matplotlib-0.98.5.1-py2.5-linux-x86_64.egg
  Processing dependencies for matplotlib==0.98.5.1
  Finished processing dependencies for matplotlib==0.98.5.1
  Exception exceptions.OSError: (2, 'No such file or directory',
'src/image.cpp') in <bound method CleanUpFile.__del__ of
<setupext.CleanUpFile instance at 0x29bb440>> ignored
  Exception exceptions.OSError: (2, 'No such file or directory',
'src/path.cpp') in <bound method CleanUpFile.__del__ of
<setupext.CleanUpFile instance at 0x29ba8c0>> ignored
  Exception exceptions.OSError: (2, 'No such file or directory',
'src/backend_gdk.c') in <bound method CleanUpFile.__del__ of
<setupext.CleanUpFile instance at 0x7fe8fa2ee998>> ignored
  Exception exceptions.OSError: (2, 'No such file or directory',
'src/backend_agg.cpp') in <bound method CleanUpFile.__del__ of
<setupext.CleanUpFile instance at 0x29bb290>> ignored

Using the standard distutils with python 2.5.1


More information about the Distutils-SIG mailing list