Author neologix
Recipients exarkun, neologix, spiv
Date 2010-04-09.19:56:16
SpamBayes Score 3.61221e-07
Marked as misclassified No
Message-id <1270842979.91.0.150766717262.issue8354@psf.upfronthosting.co.za>
In-reply-to
Content
Attached are two patches:
- test_signal_siginterrupt.diff is a patch for Lib/test/test_signal.py to check for this problem (more than one signal received after calling signal.siginterrupt())
before:
$ ./python Lib/test/regrtest.py test_signal
test_signal
1 test OK.

after:
$ ./python Lib/test/regrtest.py test_signal
test_signal
test test_signal failed -- Traceback (most recent call last):
  File "/home/cf/python/trunk/Lib/test/test_signal.py", line 299, in test_siginterrupt_off
    self.assertEquals(i, False)
AssertionError: True != False

1 test failed:
    test_signal

- signal_noreinstall.diff is a patch against Modules/signalmodule.c which modifies signal_handler() to call PyOS_setsig() only when sigaction is not available, since in that case the signal handler doesn't need to be reinstalled. This solves this problem, and also saves a call to sigaction every time a signal is received (even if its probably doesn't cost much).

with patch and updated test:
$ ./python Lib/test/regrtest.py test_signal
test_signal
1 test OK.

Of course, this also corrects the problem with sig-test.py, the terminal can be resized indefinitely.
I also passed test_subprocess and test_socketserver just to be sure, but reviews are more than welcome.
History
Date User Action Args
2010-04-09 19:56:20neologixsetrecipients: + neologix, spiv, exarkun
2010-04-09 19:56:19neologixsetmessageid: <1270842979.91.0.150766717262.issue8354@psf.upfronthosting.co.za>
2010-04-09 19:56:16neologixlinkissue8354 messages
2010-04-09 19:56:16neologixcreate