exec code with timeout?

John J. Lee jjl at pobox.com
Mon Sep 8 13:53:56 CEST 2003

Alex Martelli <aleax at aleax.it> writes:
> Graham Fawcett wrote:
> > Hmm... well, again I'd suggest the PyThreadState_SetAsyncExc function. It
> > shouldn't be that hard to wrap... I'd try it myself, but haven't made it
> > to 2.3 yet.  :(
> Nope -- the attacking script can easily use try/except to defeat attempts
> to kill it via PyThreadState_SetAsyncExc .  The latter isn't meant for any
> "adversarial" situation, but just for potentially _buggy_ threads.

Which is what the OP asked for, actually -- the users are trusted.

Agreed that a separate process still seems better, though.


More information about the Python-list mailing list