[ python-Bugs-1030388 ] os.system exhausts file descriptors
SourceForge.net
noreply at sourceforge.net
Tue Sep 21 21:14:06 CEST 2004
Bugs item #1030388, was opened at 2004-09-18 19:30
Message generated for change (Comment added) made by loewis
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1030388&group_id=5470
Category: Python Library
>Group: 3rd Party
>Status: Closed
>Resolution: Invalid
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.
----------------------------------------------------------------------
>Comment By: Martin v. Löwis (loewis)
Date: 2004-09-21 21:14
Message:
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.
----------------------------------------------------------------------
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