#14636: ECL spkg : dirty workarounds?
--------------------------------------+-------------------------------------
Reporter: Snark | Owner: jdemeyer
Type: defect | Status: needs_work
Priority: major | Milestone: sage-pending
Component: packages: standard | Resolution:
Keywords: | Work issues: doctest
Report Upstream: N/A | Reviewers:
Authors: | Merged in:
Dependencies: | Stopgaps:
--------------------------------------+-------------------------------------
Changes (by jdemeyer):
* status: needs_review => needs_work
* work_issues: => doctest
Comment:
Please add the following doctest (`sage/tests/interrupt.pyx` is a good
place for this test):
{{{
"""
Show that `SIGCHLD` is completely ignored by default. If the process
`p` finishes, there should be no `SIGCHLD` signal, so ``select()`` will
simply time out::
sage: from select import select
sage: import subprocess
sage: p = subprocess.Popen(["sleep", "1"]) # long time
sage: select([], [], [], 1.5) # long time
([], [], [])
sage: p.poll() # long time
0
We now do the same but after installing a dummy `SIGCHLD`
handler::
sage: import signal
sage: def dummy_handler(a,b):
....: pass
sage: signal.signal(signal.SIGCHLD, dummy_handler) # random
sage: p = subprocess.Popen(["sleep", "1"]) # long time
sage: select([], [], [], 1.5) # long time
Traceback (most recent call last):
...
error: (4, 'Interrupted system call')
sage: p.poll() # long time
0
Reset the `SIGCHLD` handler::
sage: signal.signal(signal.SIGCHLD, signal.SIG_IGN) # random
"""
}}}
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/14636#comment:15>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.