New issue 2059: json not usable inside sandbox
https://bitbucket.org/pypy/pypy/issue/2059/json-not-usable-inside-sandbox
tinloaf:
Hi,
if I run a script that imports json inside a sandbox, this happens:
```
#!shell
tinloaf@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?
_______________________________________________
pypy-issue mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-issue