[ python-Bugs-1030388 ] os.system exhausts file descriptors
SourceForge.net
noreply at sourceforge.net
Sat Sep 18 19:30:56 CEST 2004
Bugs item #1030388, was opened at 2004-09-18 17:30
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1030388&group_id=5470
Category: Python Library
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Eray Ozkural (exa)
Assigned to: Nobody/Anonymous (nobody)
Summary: os.system exhausts file descriptors
Initial Comment:
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.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1030388&group_id=5470
More information about the Python-bugs-list
mailing list