[Distutils] buildout/distribute recursion error fixed

Reinout van Rees reinout at vanrees.org
Thu Nov 5 09:32:16 CET 2009


Hi all,

Several people have seen a hard-to-reproduce recursion error when running
buildout in combination with distribute.  You'd get 200 lines of
"distribute".

Good news: the problem has been identified.  And I've fixed it on a
zc.buildout branch (branches/reinout_distribute_upgrade_check).  Tarek will
test it and probably/hopefully release it real soon, wink, wink.


Buildout's easy_install.py module detects the location of setuptools and
buildout at import time and uses those paths when creating scripts.
Setuptools's path is also used when calling easy_install to install .tgz
files.

Problem: the install() method that calls easy_install detects the setuptools
location all over again at runtime.  And there's a recursion in there.  The
method that searches for the available setuptools detects that there's a new
version available and tries to install() it.  And searches for the setuptools
location.  And tries to install() it.  Repeat.

I fixed it by simply using the pre-detected setuptools location.

Note that setuptools did not have this recursion problem solely because it was
packaged as an ``.egg``, which does not have to go through the easy_install
step!  So distribute's (necessary) packaging as a tgz exposed this bug.


Reinout

-- 
Reinout van Rees - reinout at vanrees.org - http://reinout.vanrees.org
Software developer at http://www.thehealthagency.com
"Military engineers build missiles. Civil engineers build targets"



More information about the Distutils-SIG mailing list