summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Doc/lib/libsite.tex29
-rw-r--r--Doc/libsite.tex29
2 files changed, 40 insertions, 18 deletions
diff --git a/Doc/lib/libsite.tex b/Doc/lib/libsite.tex
index 3dffd1c..f38214f 100644
--- a/Doc/lib/libsite.tex
+++ b/Doc/lib/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}
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}