I don't consider having to look up documentation for a function in a
completely different language (in this case, C) as "documented behaviour of
os.system".
Well, tough luck. os.system() is a wrapper around the platform's system().
The authors of the Python documentation cannot possibly know what that
function will do on all platforms, even less so once you factor in the
user's ability to replace that function via platform-specific means.
Does the C standard define the behaviour of system(), or is that
implementation dependent?
The C99 standard says:
7.20.4.5 The system function
Synopsis
[#1]
#include <stdlib.h>
int system(const char *string);
Description
[#2] If string is a null pointer, the system function
determines whether the host environment has a command
processor. If string is not a null pointer, the system
function passes the string pointed to by string to that
command processor to be executed in a manner which the
implementation shall document; this might then cause the
program calling system to behave in a non-conforming manner
or to terminate.
Returns
[#3] If the argument is a null pointer, the system function
returns nonzero only if a command processor is available.
If the argument is not a null pointer, and the system
function does return, it returns an implementation-defined
value.
It doesn't require a platform to even have a command interpreter, let
alone specify its behaviour. On Unix, system() is defined to use /bin/sh,
which ought to be some kind of Bourne shell; but even then, it might be a
minimal shell such as dash or something with many extensions such as bash.
On Windows, it uses the interpreter specified by the COMSPEC environment
variable, or cmd.exe (NT-based) or command.com (DOS-based) if COMSPEC
isn't set (in either case, PATH is used).
It sounds to me that the Python developers are
implicitly refusing responsibility for the detailed behaviour of os.system
by noting that it depends on the C function.
Indeed. Which is the correct thing to do. Practically every function in
the os module does likewise.
What do Jython, PyPy and IronPython do?
I don't know, but I would expect them to use libc's system() function,
except for Jython which might use java.lang.Runtime.exec().