This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author neologix
Recipients mouad, neologix, vstinner
Date 2011-06-25.15:59:02
SpamBayes Score 1.0582342e-08
Marked as misclassified No
Message-id <1309017543.71.0.579565358621.issue12410@psf.upfronthosting.co.za>
In-reply-to
Content
It's a little bit more complicated than that:
- signals and threads don't mix well together
- this will make syscalls fail with EINTR
- the old SIGALRM handler is lost
- etc

In short, don't use signals.
I'm not sure there's a reliable way to write such a general-purpose wrapper (usually one can use select() with a timeout or spawn a subprocess and use communicate's timeout to achieve this kind of things).
In your use case (issue #12157), I think that letting the test block is fine, since:
- there's no easy way to add a timeout (but you could spawn a new interpreter and use communicate with a timeout if you really wanted to)
- it will be caught by the faulthandler module
- a test killed by faulthandler's timeout is more interesting to fix that a "common" failed test ;-)
History
Date User Action Args
2011-06-25 15:59:03neologixsetrecipients: + neologix, vstinner, mouad
2011-06-25 15:59:03neologixsetmessageid: <1309017543.71.0.579565358621.issue12410@psf.upfronthosting.co.za>
2011-06-25 15:59:03neologixlinkissue12410 messages
2011-06-25 15:59:03neologixcreate