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

Skip to content

Commit dbaf04e

Browse files
committed
Straighten out the docs for os.system(); the Unix and Windows behaviors
really can't be smushed together. Bugfix candidate.
1 parent 6bab183 commit dbaf04e

1 file changed

Lines changed: 13 additions & 5 deletions

File tree

Doc/lib/libos.tex

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1514,11 +1514,19 @@ \subsection{Process Management \label{os-process}}
15141514
calling the Standard C function \cfunction{system()}, and has the
15151515
same limitations. Changes to \code{posix.environ}, \code{sys.stdin},
15161516
etc.\ are not reflected in the environment of the executed command.
1517-
The return value is the exit status of the process encoded in the
1518-
format specified for \function{wait()}, except on Windows 95 and 98,
1519-
where it is always \code{0}. Note that \POSIX{} does not specify the
1520-
meaning of the return value of the C \cfunction{system()} function,
1521-
so the return value of the Python function is system-dependent.
1517+
1518+
On \UNIX the return value is the exit status of the process encoded in the
1519+
format specified for \function{wait()}. Note that \POSIX{} does not
1520+
specify the meaning of the return value of the C \cfunction{system()}
1521+
function, so the return value of the Python function is system-dependent.
1522+
1523+
On Windows the return value is that returned by the system shell after
1524+
running \var{command}, given by the Windows environment variable
1525+
\code{COMSPEC}: on \code{command.com} systems (Windows 95, 98 and ME)
1526+
this is always \code{0}; on \code{cmd.exe} systems (Windows NT, 2000
1527+
and XP) this is the exit status of the command run; on systems using
1528+
a non-native shell, consult your shell documentation.
1529+
15221530
Availability: \UNIX, Windows.
15231531
\end{funcdesc}
15241532

0 commit comments

Comments
 (0)