[Pythonmac-SIG] What should be on sys.path for MacPython 2.3

Stuart Bishop zen@shangri-la.dropbear.id.au
Fri, 11 Apr 2003 17:19:52 +1000


On Friday, April 11, 2003, at 07:15  AM, Jack Jansen wrote:

> Problem is that there are a number of reasonable places we could put 
> these user-extensions:
> - ~/Library/Python - Perl seems to do it this way.
> - ~/Library/Application Support/Python - Seems like a better location

Is ~ the logged in users home directory or the home directory of the 
effective
uid?

If it is the home directory of the logged in user, it could be a
security problem if there is a python script that runs with elevated
privs (oops.... PYTHONSTARTUP env variable may already allow this,
unless python -E turns this feature off).

If it is the home directory of the effective uid, what happens if it
changes whilst a script is running?

> - One of the above, with "site-packages" appended - allows for more 
> stuff in there, like IDE plugins, Package Manager packages, etc.
> - One of the above, with $(VERSION)/site-packages appended - allows 
> for installation of multiple Python versions without the binary 
> extension modules getting in each others hair.

Need at least $(VERSION).

> distutils should probably be aware of this convention, and if 
> site-packages isn't writable to the current user fallback to the 
> directory above (or at least give a warning explaining how to do > 
> this).

This could be a generic patch, substituting ~/.python for other Unixes
and the Windows people might add a prefix for their platform.

> For completeness we could always add the user directory to sys.path, 
> and add the other two (/Library, /Network/Library) only if they exist.

Do we actually want /Library ? That would make two standard locations
to install machine-wide site-packages. Unless of course MacPython will
be installing the python libraries into /Library/Python/2.3.

-- 
Stuart Bishop <zen@shangri-la.dropbear.id.au>
http://shangri-la.dropbear.id.au/