[Distutils] Distutils 2.6.2 changes will break setuptools

Tarek Ziadé ziade.tarek at gmail.com
Sun Feb 22 04:50:09 CET 2009

On Sun, Feb 22, 2009 at 4:30 AM, P.J. Eby <pje at telecommunity.com> wrote:
> At 11:55 PM 2/21/2009 +0100, Tarek Ziadé wrote:
>> Hi Phillip,
>> Some changes in distutils/sdist are breaking some commands in
>> setuptools' egg_info because of a getattr that make a recursive error,
>> I think it could be a great thing to fix it as soon as possible before
>> Python 2.6.1 is out,

Typo : before the first version of 2.7 is out

Notice that standalone releases of Distutils are planned soon, including a
development snapshots, so it should be easier to test the latest changes.

>> I am available if you need more info on this
> At a bare minimum, the Python SVN revision numbers and the resulting
> traceback would be helpful.  A bug filed to the setuptools tracker would
> probably also be a good idea, so that I'm not the only person who can look
> at it or provide a fix...  either for setuptools or the stdlib, as
> appropriate.


it happens because setuptools build_py implementation has a __getattr__ that
computes data_file::

  def __getattr__(self,attr):
        if attr=='data_files':  # lazily compute data files
            self.data_files = files = self._get_data_files(); return files
        return _build_py.__getattr__(self,attr)

But Distutils sdist command loops over build_py.data_files to add them
in the MANIFEST file,
because this attribute should be computed by finalize_command.

And this is done when sdist.add_default is called, so it loops
recursively and dies

see "for pkg, src_dir, build_dir, filenames in build_py.data_files: in"



Tarek Ziadé | Association AfPy | www.afpy.org
Blog FR | http://programmation-python.org
Blog EN | http://tarekziade.wordpress.com/

More information about the Distutils-SIG mailing list