STINNER Victor <[EMAIL PROTECTED]> added the comment:
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()
---
----------
nosy: +haypo
_______________________________________
Python tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue3392>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com