[Python-checkins] r60045 - peps/trunk/pep-0370.txt

christian.heimes python-checkins at python.org
Fri Jan 18 12:09:19 CET 2008


Author: christian.heimes
Date: Fri Jan 18 12:09:18 2008
New Revision: 60045
Modified:
 peps/trunk/pep-0370.txt
Log:
PEP 370 update
I added or changed some points of the PEP as discussed on the mailing list recently
Modified: peps/trunk/pep-0370.txt
==============================================================================
--- peps/trunk/pep-0370.txt	(original)
+++ peps/trunk/pep-0370.txt	Fri Jan 18 12:09:18 2008
@@ -53,9 +53,7 @@
 directory is specific to a Python version. The path contains
 the version number (major and minor only).
 
- Mac
- ``~/Library/Python/2.6/site-packages``
- Unix
+ Unix (including Mac)
 ``~/.local/lib/python2.6/site-packages``
 Windows
 ``%APPDATA%/Python/Python26/site-packages``
@@ -66,9 +64,7 @@
 for Python version specific data like config files, docs, images
 and translations.
 
- Mac
- ``~/Library/Python/2.6``
- Unix
+ Unix (including Mac)
 ``~/.local/lib/python2.6``
 Windows
 ``%APPDATA%/Python/Python26``
@@ -79,9 +75,7 @@
 use config directory are inside the base directory. On some systems
 the directory may be shared with 3rd party apps.
 
- Mac
- ``~/Library/Python``
- Unix
+ Unix (including Mac)
 ``~/.local``
 Windows
 ``%APPDATA%/Python``
@@ -91,24 +85,46 @@
 A directory for binaries and scripts. [10]_ It's shared across Python
 versions and the destination directory for scripts.
 
- Mac
- ``~/Library/Python/bin``
- Unix
+ Unix (including Mac)
 ``~/.local/bin``
 Windows
 ``%APPDATA%/Python/Scripts``
 
 
-On Windows ``APPDATA`` was chosen because it is the most logical place for
-application data. Microsoft recommands that software doesn't write to
-``USERPROFILE`` [5]_ and ``My Documents`` is not suited for application data,
-too. [8]_
+Windows Notes
+-------------
 
-On Linux ``~/.local`` was chosen in favor over ``~/.python`` because the
+On Windows the *Application Data* directory (aka ``APPDATA``) was chosen 
+because it is the most designated place for application data. Microsoft
+recommands that software doesn't write to ``USERPROFILE`` [5]_ and
+``My Documents`` is not suited for application data, too. [8]_ The code
+doesn't query the Win32 API, instead it uses the environment variable
+%APPDATA%.
+
+The application data directory is part of the roaming profile. In networks
+with domain logins the application data may be copied from and to the a
+central server. This can slow down log-in and log-off. Users can keep
+the data on the server by e.g. setting PYTHONUSERBASE to the value
+"%HOMEDRIVE%%HOMEPATH%\Applicata Data". Users should consult their local
+adminstrator for more information. [13]_
+
+
+Unix Notes
+----------
+
+On Unix ``~/.local`` was chosen in favor over ``~/.python`` because the
 directory is already used by several other programs in analogy to
 ``/usr/local``. [7]_ [11]_
 
 
+Mac OS X Notes
+--------------
+
+On Mac OS X Python uses ~/.local directory as well. [12]_ Framework builds
+if Python include ``~/Library/Python/2.6/site-packages`` as an additional
+search path. 
+
+
 Implementation
 ==============
 
@@ -126,9 +142,10 @@
 ``PYTHONPATH``.
 
 For security reasons the user site directory is *not* added to
-``sys.path`` when the effective user id is not equal to the process
-user id [9]_. It prevents users from injecting Python code into suid
-apps.
+``sys.path`` when the effective user id or group id is not equal to the
+process uid / gid [9]_. It's an additional barrier against code injection
+into suid apps. However Python suid scripts *must* always use the -E
+and -s option or users can sneak in their own code.
 
 The user site directory can be suppressed with a new option ``-s`` or
 the environment variable ``PYTHONNOUSERSITE``. The feature can be
@@ -136,6 +153,10 @@
 ``False``. It must be set by editing ``site.py``. It can't be altered
 ``in sitecustomize.py`` or later.
 
+The path to the user base directory can be overwritten with the
+environment variable ``PYTHONUSERBASE``. The default location is used
+when ``PYTHONUSERBASE`` is not set or empty.
+
 ``distutils.command.install`` (setup.py install) gets a new argument
 ``--user`` to install packages in the user site directory. The required
 directories are created on demand.
@@ -153,27 +174,6 @@
 TBD
 
 
-Open Questions
-==============
-
-* Are the directories for Windows, Mac and Unix fine?
-
-* Mac: Should framework and non-framework builds of Python use the
- same directories?
-
-* The patch also adds a usercustomize hook to site. Is it useful and
- should it stay?
-
-* Should the site package directory also be ignored if process gid !=
- effective gid?
-
-* Should the Windows installer add ``%APPDATA%/Python/Scripts`` to
- ``PATH``?
-
-* Should the base directory be configurable with an environment variable
- like ``PYTHONUSERHOME``?
-
-
 Reference Implementation
 ========================
 
@@ -224,6 +224,12 @@
 .. [11] freedesktop.org XGD basedir specs mentions ~/.local
 http://www.freedesktop.org/wiki/Specifications/basedir-spec
 
+.. [12] ~/.local for Mac and usercustomize file
+ http://permalink.gmane.org/gmane.comp.python.devel/91167
+
+.. [13] Roaming profile on Windows
+ http://permalink.gmane.org/gmane.comp.python.devel/91187
+
 ..
 Local Variables:
 mode: indented-text


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /