R. David Murray added the comment:
Agree with the rejection. os.system is intended to be a minimal wrapper around
the system call, as are most things in the os module, and as such mirroring the
behavior of the system call (by returning -1) is less surprising than raising
an exception, even
Ramchandra Apte added the comment:
+1 on exception
--
nosy: +ramchandra.apte
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16548
___
___
Mark Dickinson added the comment:
-1 on an exception. This would be a backwards-incompatible API change, so
could only happen in Python 3.4. os.system is well documented, including a
recommendation to use the subprocess module instead.
Reclassifying as a feature request, since this isn't a
New submission from masterid:
os.system won't run any command and there is no error message when memory
cannot be allocated.
It looks like Python is running a command but actually nothing happens.
I used subprocess.Popen instead and found out that
OSError: [Errno 12] Cannot allocate memory
I
Jesús Cea Avión added the comment:
If Unix system call system() fails, it will return -1. Python should convert
a -1 to the appropiate exception, checking errno.
In Solaris, for instance, system() is documented to fail if the max number of
processes are reached, if the syscall was interrupted