> Just forbid the sandboxed code from using the signal module, and set
> the signal to the default action (abort).

Ah yes, good idea. It may be an option because depending on the use
case, failing with abort is not always the best option.

The signal module is not allowed by the default policy.

>> Apply the timeout would require to modify the sum() function. A more
>> generic solution would be to use a subprocess.
>
> Maybe it would make more sense to add such a test to xrange()? (Maybe
> not every iteration but every 10 or 100 iterations.)

pysandbox may replace some functions by functions checking regulary
the timeout to raise a Python exception instead of aborting the
process.

Victor
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to