[Distutils] Bugginess in distutils.core.run_setup?

Phillip J. Eby pje at telecommunity.com
Mon Oct 17 21:18:06 CEST 2005

At 08:41 PM 10/17/2005 +0200, Arve Knudsen wrote:
>Sorry if this has been asked before, but I'm having difficulties in using
>the distutils.core.run_setup function. Setup scripts that will work
>happily when run from the commandline ("python setup.py") bomb out when
>under run_setup. What happens as far as I can tell is that run_setup
>provides a "locals" argument for execfile, which is used for "import"
>statements. What happens then is that imports on the global level are not
>visible to functions, so an exception is raised when a function tries to
>access a globally imported module. Is this due to faulty logic in
>run_setup (explicitly specifying the "locals" argument)?

The run_setup() is broken in more ways than that.  I've usually found it 
simpler to just write my own, e.g. setuptools.sandbox.run_setup().

More information about the Distutils-SIG mailing list