[pypy-issue] Issue #2059: json not usable inside sandbox (pypy/pypy)

tinloaf issues-reply at bitbucket.org
Fri Jun 5 03:20:39 CEST 2015

New issue 2059: json not usable inside sandbox



if I run a script that imports json inside a sandbox, this happens:


tinloaf at janeway sandbox % python2 ./pypy_interact.py --tmp=/tmp/ship ../goal/pypy-c start_ship.py
'import site' failed
Traceback (most recent call last):
  File "<builtin>/app_main.py", line 75, in run_toplevel
  File "start_ship.py", line 1, in <module>
    from computer import ship_computer
  File "/tmp/computer.py", line 1, in <module>
    from lcars import LCARS
  File "/tmp/lcars.py", line 1, in <module>
    import json
  File "/bin/lib-python/2.7/json/__init__.py", line 114, in <module>
    from .decoder import JSONDecoder
  File "/bin/lib-python/2.7/json/decoder.py", line 5, in <module>
    import struct
  File "/bin/lib-python/2.7/struct.py", line 1, in <module>
    from _struct import *
ImportError: No module named _struct
[Subprocess exit code: 1]


It looks like json needs some lowlevel C module, and that is not properly imported into the sandbox?

More information about the pypy-issue mailing list