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 vstinner
Recipients benjamin.peterson, exarkun, gregory.p.smith, loewis, marcin.bachry, neologix, pitrou, python-dev, schmichael, spiv, tseaver, vstinner
Date 2011-05-08.19:50:43
SpamBayes Score 1.04511e-12
Marked as misclassified No
Message-id <>
> New changeset f8c49a930015 by Victor Stinner in branch 'default':
> Issue #8407: The signal handler writes the signal number as a single byte

Wakeup test using two pending signals fails on FreeBSD 6.4 buildbot:

FAIL: test_signum (test.test_signal.WakeupSignalTests)
Traceback (most recent call last):
  File "/usr/home/db3l/buildarea/3.x.bolen-freebsd/build/Lib/test/", line 266, in test_signum
    self.check_signum(signal.SIGUSR1, signal.SIGALRM)
  File "/usr/home/db3l/buildarea/3.x.bolen-freebsd/build/Lib/test/", line 232, in check_signum
    self.assertSequenceEqual(raised, signals)
AssertionError: Sequences differ: (14,) != (30, 14)

Wakeup file only contains SIGALRM, not (SIGUSR1, SIGALRM), whereas SIGUSR1 is raised before SIGALRM.

Code of the test:
    def check_signum(self, *signals):                                           
        data =, len(signals)+1)                               
        raised = struct.unpack('%uB' % len(data), data)                         
        self.assertSequenceEqual(raised, signals)

    def test_signum(self):                                                      
        old_handler = signal.signal(signal.SIGUSR1, lambda x,y:None)            
        self.addCleanup(signal.signal, signal.SIGUSR1, old_handler)             
        os.kill(os.getpid(), signal.SIGUSR1)                                    
        os.kill(os.getpid(), signal.SIGALRM)                                    
        self.check_signum(signal.SIGUSR1, signal.SIGALRM)
Date User Action Args
2011-05-08 19:50:44vstinnersetrecipients: + vstinner, loewis, gregory.p.smith, spiv, exarkun, tseaver, pitrou, benjamin.peterson, marcin.bachry, schmichael, neologix, python-dev
2011-05-08 19:50:44vstinnersetmessageid: <>
2011-05-08 19:50:43vstinnerlinkissue8407 messages
2011-05-08 19:50:43vstinnercreate