Hi Yicong,

No, PyPy cannot be embedded running sandbox.  The way we present
embedding is by using the cffi module on the Python code; but this
module is not available at all in a sandboxed PyPy (as it allows
random invalid things to occur).

If you really want to use the sandbox, you need to consider a
completely different approach: run ``pypy-sandbox`` as a subprocess,
as documented on the sandboxing section on http://pypy.org/ .  But
note that sandboxing is a prototype that was never really finished
(even though it should be safe).  What would be missing for you would
be the whole C code that talks over stdin/stdout to the subprocess.

Alternatively, we could imagine to embed a ``pypy-sandbox.so`` as a
dynamically linked library.  There is no API for that, though.  It
would need to be defined and cannot be just an
``pypy_execute_source()`` function, because the Python side cannot use
cffi.


A bientôt,

Armin.
_______________________________________________
pypy-dev mailing list
pypy-dev@python.org
https://mail.python.org/mailman/listinfo/pypy-dev

Reply via email to