Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
codejail
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
codejail
Commits
201f9be5
Commit
201f9be5
authored
Feb 19, 2013
by
Ned Batchelder
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Try to find the sandbox in a few places.
parent
06673713
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
15 deletions
+14
-15
codejail/jailpy.py
+14
-15
No files found.
codejail/jailpy.py
View file @
201f9be5
...
...
@@ -14,24 +14,23 @@ from .util import temp_directory
# TODO: limit too much stdout data?
DEBUG
=
False
STRICT
=
True
# Configure the Python command
SANDBOX_PYTHON
=
"/usr/bin/python-sandbox"
if
os
.
path
.
exists
(
SANDBOX_PYTHON
):
# Python -S inhibits loading site.py, which prevent Ubuntu from adding
# specialized traceback handlers that fail in the sandbox.
PYTHON_CMD
=
[
'sudo'
,
'-u'
,
'sandbox'
,
SANDBOX_PYTHON
,
'-S'
]
elif
STRICT
:
raise
Exception
(
"Couldn't find Python sandbox"
)
SANDBOX_POSSIBILITIES
=
[
"~/mitx_all/python-sandbox/bin/python"
,
"/usr/bin/python-sandbox"
,
]
for
sandbox_python
in
SANDBOX_POSSIBILITIES
:
sandbox_python
=
os
.
path
.
expanduser
(
sandbox_python
)
if
os
.
path
.
exists
(
sandbox_python
):
PYTHON_CMD
=
[
'sudo'
,
'-u'
,
'sandbox'
,
sandbox_python
,
'-E'
,
]
break
else
:
PYTHON_CMD
=
[
'python'
,
'-S'
]
raise
Exception
(
"Couldn't find Python sandbox"
)
class
JailResult
(
object
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment