]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Give in to Mike Meyer -- add *both* lib/python1.5/packages and
authorGuido van Rossum <guido@python.org>
Wed, 3 Sep 1997 22:05:54 +0000 (22:05 +0000)
committerGuido van Rossum <guido@python.org>
Wed, 3 Sep 1997 22:05:54 +0000 (22:05 +0000)
lib/site-python to the path (if they exist).  This is a reasonable
compromise.

Doc/lib/libsite.tex
Doc/libsite.tex

index 3dffd1ceec0f92ea66811c65c85069c420b9bf94..f38214f2ce2ca63ce53a771cbd34db01ab57efb3 100644 (file)
@@ -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}
index 3dffd1ceec0f92ea66811c65c85069c420b9bf94..f38214f2ce2ca63ce53a771cbd34db01ab57efb3 100644 (file)
@@ -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}