summaryrefslogtreecommitdiffstats
path: root/Doc/lib/libos.tex
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2004-07-26 00:42:41 (GMT)
committerTim Peters <tim.peters@gmail.com>2004-07-26 00:42:41 (GMT)
commitd6ef19309d9d41c35edb1f05235eda60952a64ea (patch)
tree42698c7239a523180c4c27e17a4ea9ce3d2e0970 /Doc/lib/libos.tex
parentd945f4e17de06cd02a8fdd887a83e7c01f121b98 (diff)
downloadcpython-d6ef19309d9d41c35edb1f05235eda60952a64ea.zip
cpython-d6ef19309d9d41c35edb1f05235eda60952a64ea.tar.gz
cpython-d6ef19309d9d41c35edb1f05235eda60952a64ea.tar.bz2
SF bugs 996748: os.environ documentation should indicate unreliability
Clarifed that os.environ is captured once; emphasized that it's better to assign to os.environ than to call putenv() directly (the putenv() docs said so, but the environ docs didn't).
Diffstat (limited to 'Doc/lib/libos.tex')
-rw-r--r--Doc/lib/libos.tex15
1 files changed, 12 insertions, 3 deletions
diff --git a/Doc/lib/libos.tex b/Doc/lib/libos.tex
index cfb32f8..f60693c 100644
--- a/Doc/lib/libos.tex
+++ b/Doc/lib/libos.tex
@@ -90,12 +90,21 @@ A mapping object representing the string environment. For example,
\code{environ['HOME']} is the pathname of your home directory (on some
platforms), and is equivalent to \code{getenv("HOME")} in C.
+This mapping is captured the first time the \module{os} module is
+imported, typically during Python startup as part of processing
+\file{site.py}. Changes to the environment made after this time are
+not reflected in \code{os.environ}, except for changes made by modifying
+\code{os.environ} directly.
+
If the platform supports the \function{putenv()} function, this
mapping may be used to modify the environment as well as query the
environment. \function{putenv()} will be called automatically when
-the mapping is modified. \note{On some platforms, including
-FreeBSD and Mac OS X, setting \code{environ} may cause memory leaks.
-Refer to the system documentation for putenv.}
+the mapping is modified.
+\note{Calling \function{putenv()} directly does not change
+\code{os.environ}, so it's better to modify \code{os.environ}.}
+\note{On some platforms, including FreeBSD and Mac OS X, setting
+\code{environ} may cause memory leaks. Refer to the system documentation
+for \cfunction{putenv()}.}
If \function{putenv()} is not provided, this mapping may be passed to
the appropriate process-creation functions to cause child processes to