summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorAndrew M. Kuchling <amk@amk.ca>2008-09-28 00:15:27 (GMT)
committerAndrew M. Kuchling <amk@amk.ca>2008-09-28 00:15:27 (GMT)
commitac77166e907e5775691f45ca5e9e070cf53378ce (patch)
treef55166c3884850cc2c4957b4af03a289c251f7d3 /Doc
parent4008ef0fe3dd2c642f402c9addd513962e361c52 (diff)
downloadcpython-ac77166e907e5775691f45ca5e9e070cf53378ce.zip
cpython-ac77166e907e5775691f45ca5e9e070cf53378ce.tar.gz
cpython-ac77166e907e5775691f45ca5e9e070cf53378ce.tar.bz2
#1579477: mention necessity to flush output before exec'ing
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/os.rst13
1 files changed, 10 insertions, 3 deletions
diff --git a/Doc/library/os.rst b/Doc/library/os.rst
index 0aa115d..c223e54 100644
--- a/Doc/library/os.rst
+++ b/Doc/library/os.rst
@@ -1451,7 +1451,13 @@ to be ignored.
These functions all execute a new program, replacing the current process; they
do not return. On Unix, the new executable is loaded into the current process,
and will have the same process id as the caller. Errors will be reported as
- :exc:`OSError` exceptions.
+ :exc:`OSError` exceptions.
+
+ The current process is replaced immediately. Open file objects and
+ descriptors are not flushed, so if there may be data buffered
+ on these open files, you should flush them using
+ :func:`sys.stdout.flush` or :func:`os.fsync` before calling an
+ :func:`exec\*` function.
The "l" and "v" variants of the :func:`exec\*` functions differ in how
command-line arguments are passed. The "l" variants are perhaps the easiest
@@ -1477,8 +1483,9 @@ to be ignored.
used to define the environment variables for the new process (these are used
instead of the current process' environment); the functions :func:`execl`,
:func:`execlp`, :func:`execv`, and :func:`execvp` all cause the new process to
- inherit the environment of the current process. Availability: Unix,
- Windows.
+ inherit the environment of the current process.
+
+ Availability: Unix, Windows.
.. function:: _exit(n)