summaryrefslogtreecommitdiffstats
path: root/Doc/lib/libos.tex
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2005-06-25 18:44:49 (GMT)
committerGeorg Brandl <georg@python.org>2005-06-25 18:44:49 (GMT)
commit837a9769c9320753cc03d8e3068fc9124c7ce5e5 (patch)
tree71d6a3f3312f92c24f802411c99bcb7ac8306468 /Doc/lib/libos.tex
parent9020a21b7c197a1f6479ea672ca9d45f978c7851 (diff)
downloadcpython-837a9769c9320753cc03d8e3068fc9124c7ce5e5.zip
cpython-837a9769c9320753cc03d8e3068fc9124c7ce5e5.tar.gz
cpython-837a9769c9320753cc03d8e3068fc9124c7ce5e5.tar.bz2
Bug [ 1225705 ] os.environ documentation should mention unsetenv
Diffstat (limited to 'Doc/lib/libos.tex')
-rw-r--r--Doc/lib/libos.tex25
1 files changed, 22 insertions, 3 deletions
diff --git a/Doc/lib/libos.tex b/Doc/lib/libos.tex
index 517bddc..aeba94a 100644
--- a/Doc/lib/libos.tex
+++ b/Doc/lib/libos.tex
@@ -106,9 +106,15 @@ the mapping is modified.
\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
-use a modified environment.
+If \function{putenv()} is not provided, a modified copy of this mapping
+may be passed to the appropriate process-creation functions to cause
+child processes to use a modified environment.
+
+If the platform supports the \function{unsetenv()} function, you can
+delete items in this mapping to unset environment variables.
+\function{unsetenv()} will be called automatically when an item is
+deleted from \code{os.environ}.
+
\end{datadesc}
\begin{funcdescni}{chdir}{path}
@@ -307,7 +313,20 @@ or even
Availability: recent flavors of \UNIX.
\end{funcdesc}
+\begin{funcdesc}{unsetenv}{varname}
+\index{environment variables!deleting}
+Unset (delete) the environment variable named \var{varname}. Such
+changes to the environment affect subprocesses started with
+\function{os.system()}, \function{popen()} or \function{fork()} and
+\function{execv()}. Availability: most flavors of \UNIX, Windows.
+When \function{unsetenv()} is
+supported, deletion of items in \code{os.environ} is automatically
+translated into a corresponding call to \function{unsetenv()}; however,
+calls to \function{unsetenv()} don't update \code{os.environ}, so it is
+actually preferable to delete items of \code{os.environ}.
+\end{funcdesc}
+\end{funcdesc}
\subsection{File Object Creation \label{os-newstreams}}