Message73585
I don't understand the problem. If you open a lot of files, the open()
loop will stop an exception (IOError: too many open files), and so
subprocess is not used.
If I open <limit>-1 files, subprocess._get_handles() will fail on
os.pipe().
If I open <limit>-4 files, the script doesn't fail.
I'm using Linux. Here is my script:
---
# open <limit>-4 files
import subprocess
files = []
while 1:
try:
newfile = open("/etc/passwd")
except IOError, err:
print "ERR: %s" % err
break
files.append(newfile)
# use -3 to get an error
for file in files[-4:]:
print "close"
file.close()
# success
subprocess.Popen(["date"], stdout=subprocess.PIPE).communicate()
--- |
|
Date |
User |
Action |
Args |
2008-09-22 16:34:05 | vstinner | set | recipients:
+ vstinner, gregory.p.smith, yorick, d_kagedal |
2008-09-22 16:34:05 | vstinner | set | messageid: <1222101245.36.0.183544146865.issue3392@psf.upfronthosting.co.za> |
2008-09-22 16:34:04 | vstinner | link | issue3392 messages |
2008-09-22 16:34:03 | vstinner | create | |
|