Alternatives to calling the pypy-c sandbox via Popen ?
In the current version of interact.py, pypy-c-sandbox is called via subprocess.Popen and the pipes are used as communication channels. To my understanding that means that a (linux) shell is spawned and pypy-c is executed in this shell (Popen) environment. I am now wondering, if it is possible to address libpypy-c.so directly, e.g. with something like ctypes ? I currently do not know the libpypy-c api, but is something of this kind thinkable (just an mock-up example):
from ctypes import CDLL
pysandbox = CDLL("libpypy-c-sandbox.so")
my_unsafe_python_code = "unsafe python code is in this string"
output_pipe = pysandbox.eval(my_unsafe_python_code) # I do not know, if eval() could be used in this way
# process output_pipe further ...
Why am I asking ? I somehow feel that there must exist a more direct (if you want, cleaner, directer or simpler) way to execute the sandbox without an additional Popen shell environment (unfortunately I am right now not too deep into the inter-process communication to make a good proposal).
Have you considered any alternative options ? Why did your final choice fell on Popen ?