another distutils question

Robert Kern robert.kern at gmail.com
Sat Sep 30 01:57:12 CEST 2006


Keith Perkins wrote:

> On a similar note , I have another question about distutils and data files.
> I have a little program that uses a txt file to store data, and it works
> fine running it in it's own folder, if I install through distutils, using
> sudo to get it to write to the site-packages folder (which root owns), it
> installs the data file so that it is owned by root, and not by me, so
> that the data file can't be written to (although the script can read it).
> Do I need to run a post install script, or add something to setup.py file
> to chown the file or am I doing something wrong?  There doesn't seem to be
> anything on this in the docs.  

There's nothing in distutils specifically that will let you do this. The root 
user will have to chown/chgrp/chmod/chwhatever the package that you installed 
manually.

You shouldn't use package data for things that are going to be modified. 
Instead, use a directory like ~/.myscript/ or something else.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
  that is made terrible by our own mad attempt to interpret it as though it had
  an underlying truth."
   -- Umberto Eco




More information about the Python-list mailing list