This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: os.system exhausts file descriptors
Type: Stage:
Components: Library (Lib) Versions:
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: exa, loewis
Priority: normal Keywords:

Created on 2004-09-18 17:30 by exa, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (2)
msg22483 - (view) Author: Eray Ozkural (exa) Date: 2004-09-18 17:30
this is a strange behavior that i could not make a concise test case 
for. 
 
i wrote a simple script to run several hundreds of jobs consecutively 
using os.system() call. on some occasions, especially when I use 
CTRL-C to break all of them to get out of the script (I didn't handle 
any signals...), i couldn't run the script again. the system gave a 
'too many files open on the system' on a linux 2.4 (debian) system. 
 
suspecting that this might be due to os.system i wrote a simple run 
function that uses os.popen() instead. 
def run(cmd): 
    a = os.popen(cmd) 
    lines = a.readlines() 
    return not a.close() 
 
and the problem never occured again. 
 
i can't tell why using os.system can cause that, i had never 
encountered this error on linux, to be honest. 
msg22484 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2004-09-21 19:14
Logged In: YES 
user_id=21627

This sounds like a bug in your C library, or an unrelated
bug in the programs you start, or in your Python
application. Python's os.system is just a thin wrapper
around system(3).

So I'm closing this as third-party unless there is some
stronger evidence that there actually is a problem with
Python here.
History
Date User Action Args
2022-04-11 14:56:07adminsetgithub: 40926
2004-09-18 17:30:55exacreate