[Distutils] setting the right owner of local subdirectories

Antoine Pitrou antoine.pitrou at wengo.fr
Wed Oct 25 12:28:53 CEST 2006


Hi,

Under Unix-alikes, you have to be root (thus using "sudo" or "su") in
order to truly install a package (even with the "develop" command since
it copies some info into the system directories).

But an annoying side-effect is that, when you first run "sudo python
setup.py develop" (or "install"), it also creates directories in the
local directory under the root user.

Which means that, when you later run commands that don't need to be root
to be issued, you get the following kinds of error:

$ ./setup.py test
running test
running egg_info
writing flapflap.egg-info/PKG-INFO
writing top-level names to flapflap.egg-info/top_level.txt
writing dependency_links to flapflap.egg-info/dependency_links.txt
writing entry points to flapflap.egg-info/entry_points.txt
error: flapflap.egg-info/entry_points.txt: Permission denied

It is a minor but repetitive annoyance. It would be nicer if, when
creating those local subdirectories, setup.py would try to change the
owner to the owner of the current parent directory (the project base
directory). 

Regards

Antoine.




More information about the Distutils-SIG mailing list