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.
Created on 2011年07月04日 22:33 by vstinner, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Messages (2) | |||
|---|---|---|---|
| msg139813 - (view) | Author: STINNER Victor (vstinner) * (Python committer) | Date: 2011年07月04日 22:33 | |
InterProcessSignalTests uses 4 different signal handlers (SIGUSR1, SIGUSR2, SIGALRM, SIGHUP) and uses 2 methods to raise a signal (a subprocess executing "kill -SIG pid" or signal.alarm(1)). It uses signal.pause() and/or time.sleep(1) to wait the signal, or just nothing for SIGUSR2 (configured to be ignored).
The testcase tests too many unrelated things.
signal.alarm(1) is not an interprocess signal: it is a signal send to the process itself.
Why using two different signal handlers? A modifies a_called, B modifies b_called but raise also a Python exception. How is it related to interprocess signal handling?
Why checking that the handler A (SIGHUP) has not been called when the signal handler B (SIGUSR1) is called?
Why is the garbage collector disabled?
I propose to write a new simple testcase: install a signal handler raising a Python exception, send a signal using a child process, ensure that the signal has been received (wait for the exception). Pseudo-code:
--------
s = signal.SIGUSR1
def handler(signum, frame): 1/0
signal.signal(s, handler)
try:
subprocess.call([sys.executable, '-c', '... kill(%s, %s)' % (os.getpid(), s))
... wait the signal ...
except ZeroDivisionError:
pass
else:
raise Exception("ZeroDivisionError not raised"
--------
The whole test has to be run in a subprocess.
The new test may pass on freebsd 6, it should be checked (see issue #12469).
|
|||
| msg178875 - (view) | Author: STINNER Victor (vstinner) * (Python committer) | Date: 2013年01月03日 01:20 | |
I don't want to work on signals anymore, and nobody looks to be interested, so I'm closing this issue. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:19 | admin | set | github: 56704 |
| 2013年01月03日 01:20:43 | vstinner | set | status: open -> closed resolution: wont fix messages: + msg178875 |
| 2011年07月04日 22:33:20 | vstinner | create | |