Skip to content

Instantly share code, notes, and snippets.

@bwesterb
Created June 25, 2015 14:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bwesterb/18a7e96799a85f7d4e5f to your computer and use it in GitHub Desktop.
Save bwesterb/18a7e96799a85f7d4e5f to your computer and use it in GitHub Desktop.
Popen bug in pypy?
import subprocess
while True:
p = subprocess.Popen(['cat'], stdin=subprocess.PIPE,
stdout=subprocess.PIPE)
p.stdin.close()
p.wait()
$ pypy bug.py
Traceback (most recent call last):
File "app_main.py", line 75, in run_toplevel
File "bug.py", line 5, in <module>
stdout=subprocess.PIPE)
File "/opt/local/lib/pypy/lib-python/2.7/subprocess.py", line 725, in __init__
errread, errwrite)
File "/opt/local/lib/pypy/lib-python/2.7/subprocess.py", line 1234, in _execute_child
errpipe_read, errpipe_write = self.pipe_cloexec()
File "/opt/local/lib/pypy/lib-python/2.7/subprocess.py", line 1186, in pipe_cloexec
r, w = os.pipe()
OSError: [Errno 24] Too many open files
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment