[issue16548] os.system won't run any command and there is no error message when memory cannot be allocated

2012-11-26 Thread R. David Murray

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 though the normal Python pattern would otherwise be to raise 
an exception.  Given that, and given that this is an API of long standing, and 
given that Popen is the real Python interface to this functionality, I agree 
that this should not be changed.

--
nosy: +r.david.murray
resolution:  - rejected
stage:  - committed/rejected
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16548
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16548] os.system won't run any command and there is no error message when memory cannot be allocated

2012-11-25 Thread Ramchandra Apte

Ramchandra Apte added the comment:

+1 on exception

--
nosy: +ramchandra.apte

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16548
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16548] os.system won't run any command and there is no error message when memory cannot be allocated

2012-11-25 Thread Mark Dickinson

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 bug.  In any case, I 
think this should be rejected.

--
nosy: +mark.dickinson
type: behavior - enhancement
versions:  -Python 2.7, Python 3.2, Python 3.3

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16548
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16548] os.system won't run any command and there is no error message when memory cannot be allocated

2012-11-24 Thread masterid

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 also tried gc.collect() to release memory, but it does not work.

--
components: Extension Modules
messages: 176321
nosy: masterid
priority: normal
severity: normal
status: open
title: os.system won't run any command and there is no error message when 
memory cannot be allocated
type: behavior
versions: Python 2.6

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16548
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16548] os.system won't run any command and there is no error message when memory cannot be allocated

2012-11-24 Thread Jesús Cea Avión

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 or if the OS doesn't have 
enough memory.

Currently, python os.system() will signal an error returning -1, instead of 
raising an exception.

Python 2.6 is open only for security fixes, retargetting 2.7, 3.2, 3.3 and 3.4.

Opinions?

--
nosy: +jcea
versions: +Python 2.7, Python 3.2, Python 3.3, Python 3.4 -Python 2.6

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16548
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com