Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 098d7fa

Browse files
committed
Document clearly that the only way to retrieve the return code from the
child processes is to use the Popen3 and Popen4 classes. This fixes SF bug #460512.
1 parent 7b07a41 commit 098d7fa

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

Doc/lib/libos.tex

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,12 @@ \subsection{File Object Creation \label{os-newstreams}}
315315
objects should be opened in binary or text mode. The default value
316316
for \var{mode} is \code{'t'}.
317317

318+
These methods do not make it possible to retrieve the return code from
319+
the child processes. The only way to control the input and output
320+
streams and also retrieve the return codes is to use the
321+
\class{Popen3} and \class{Popen4} classes from the \refmodule{popen2}
322+
module; these are only available on \UNIX.
323+
318324
\begin{funcdesc}{popen2}{cmd\optional{, mode\optional{, bufsize}}}
319325
Executes \var{cmd} as a sub-process. Returns the file objects
320326
\code{(\var{child_stdin}, \var{child_stdout})}.

Doc/lib/libpopen2.tex

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,13 @@ \section{\module{popen2} ---
2424
in binary or text mode. The default value for \var{mode} is
2525
\code{'t'}.
2626

27+
The only way to retrieve the return codes for the child processes is
28+
by using the \method{poll()} or \method{wait()} methods on the
29+
\class{Popen3} and \class{Popen4} classes; these are only available on
30+
\UNIX. This information is not available when using the
31+
\function{popen2()}, \function{popen3()}, and \function{popen4()}
32+
functions, or the equivalent functions in the \refmodule{os} module.
33+
2734
\begin{funcdesc}{popen2}{cmd\optional{, bufsize\optional{, mode}}}
2835
Executes \var{cmd} as a sub-process. Returns the file objects
2936
\code{(\var{child_stdout}, \var{child_stdin})}.

0 commit comments

Comments
 (0)