Add some logging to codejail

This commit is contained in:
Ned Batchelder
2013-02-25 16:04:59 -05:00
parent 771de938c7
commit d9df65eef0

View File

@@ -3,6 +3,7 @@
# Instructions:
# - AppArmor.md from xserver
import logging
import os, os.path
import resource
import shutil
@@ -13,6 +14,8 @@ import time
from .util import temp_directory
log = logging.getLogger(__name__)
# TODO: limit too much stdout data?
# Configure the Python command
@@ -61,6 +64,8 @@ def jailpy(code, files=None, argv=None, stdin=None):
with temp_directory(delete_when_done=True) as tmpdir:
log.debug("Executing jailed code: %r", code)
# All the supporting files are copied into our directory.
for filename in files or ():
if os.path.isfile(filename):