summaryrefslogtreecommitdiffstats
path: root/Doc/libsite.tex
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1997-09-03 22:05:54 (GMT)
committerGuido van Rossum <guido@python.org>1997-09-03 22:05:54 (GMT)
commitf01dff7e93993c01f9883de5b456ccac32f550a9 (patch)
tree8f8f2f8c77683c900adfdffca876510e5e812ee3 /Doc/libsite.tex
parentad87d3e826439e319b35bb0f4fa1b5a0bac55ed1 (diff)
downloadcpython-f01dff7e93993c01f9883de5b456ccac32f550a9.zip
cpython-f01dff7e93993c01f9883de5b456ccac32f550a9.tar.gz
cpython-f01dff7e93993c01f9883de5b456ccac32f550a9.tar.bz2
Give in to Mike Meyer -- add *both* lib/python1.5/packages and
lib/site-python to the path (if they exist). This is a reasonable compromise.
Diffstat (limited to 'Doc/libsite.tex')
-rw-r--r--Doc/libsite.tex29
1 files changed, 20 insertions, 9 deletions
diff --git a/Doc/libsite.tex b/Doc/libsite.tex
index 3dffd1c..f38214f 100644
--- a/Doc/libsite.tex
+++ b/Doc/libsite.tex
@@ -9,18 +9,29 @@ modules that needed to use site-specific modules would place
\code{import site} somewhere near the top of their code. This is no
longer necessary.
-This will append up site-specific paths to to the module search path.
-It starts with \code{sys.prefix} and \code{sys.exec_prefix} (if
-different) and appends \file{lib/python\var{version}/packages}. The
-resulting directory, if it exists, is added to \code{sys.path}, and
-also inspected for path configuration files. A path configuration
-file is a file whose name has the form \file{\var{package}.pth}; its
-contents are additional directories (one per line) to be added to
-\code{sys.path}. Non-existing directories (or non-directories) are
-never added to \code{sys.path}; no directory is added to
+This will append site-specific paths to to the module search path.
+
+It starts by constructing up to four directories from a head and a
+tail part. For the head part, it uses \code{sys.prefix} and
+\code{sys.exec_prefix}; empty heads are skipped. For
+the tail part, it uses the empty string (on Mac or Windows) or it uses
+first \file{lib/python\var{version}/packages} and then
+\file{lib/site-python} (on Unix). For each of the distinct head-tail
+combinations, it sees if it refers to an existing directory, and if
+so, adds to \code{sys.path}, and also inspected for path configuration
+files.
+\indexii{site-python}{directory}
+\indexii{packages}{directory}
+
+A path configuration file is a file whose name has the form
+\file{\var{package}.pth}; its contents are additional items (one
+per line) to be added to \code{sys.path}. Non-existing items are
+never added to \code{sys.path}, but no check is made that the item
+refers to a directory (rather than a file). No item is added to
\code{sys.path} more than once. Blank lines and lines beginning with
\code{\#} are skipped.
\index{package}
+\indexiii{path}{configuration}{file}
\kwindex{sys.prefix}
\kwindex{sys.exec_prefix}
\kwindex{prefix}