Reputation: 20358
I went to write a system script using 3.0 and found the SIGALRM signal and signal.alarm() call missing amongst many others on the Windows deployment. Does anyone know why these are missing? Below is a dir() of the 2.5 vs 3.0 signal packages on windows. I haven't found any 3.0 docs yet mentioning that this was moved
EDIT: signals do work in python25 on windows, they were removed in 3.0. I should reword my request as 'where did they go or get turned into' or is the windows 3.0 release just not complete yet?
python25> python
Python 2.5.1 (r251:54863, May 18 2007, 16:56:43)
[GCC 3.4.4 (cygming special, gdc 0.12, using dmd 0.125)] on cygwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import signal
>>> dir(signal)
['NSIG', 'SIGABRT', 'SIGALRM', 'SIGBUS', 'SIGCHLD', 'SIGCLD',
'SIGCONT', 'SIGEMT', 'SIGFPE', 'SIGHUP', 'SIGILL', 'SIGINT ', 'SIGIO',
'SIGKILL', 'SIGPIPE', 'SIGPOLL', 'SIGPROF', 'SIGQUIT', 'SIGRTMAX',
'SIGRTMIN', 'SIGSEGV', 'SIGSTOP', 'SIGSYS ', 'SIGTERM', 'SIGTRAP',
'SIGTSTP', 'SIGTTIN', 'SIGTTOU', 'SIGURG', 'SIGUSR1', 'SIGUSR2',
'SIGVTALRM', 'SIGWINCH', 'SIGX CPU', 'SIGXFSZ', 'SIG_DFL', 'SIG_IGN',
'__doc__', '__name__', 'alarm', 'default_int_handler', 'getsignal',
'pause', 'sig nal']
>>> exit()
python25> cd ../python31
python31> python
Python 3.1.1 (r311:74483, Aug 17 2009, 17:02:12) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import signal
>>> dir(signal)
['NSIG', 'SIGABRT', 'SIGBREAK', 'SIGFPE', 'SIGILL', 'SIGINT',
'SIGSEGV', 'SIGTERM', 'SIG_DFL', 'SIG_IGN', '__doc__', '__ name__',
'__package__', 'default_int_handler', 'getsignal', 'set_wakeup_fd',
'signal']
>>>
Upvotes: 3
Views: 1049
Reputation: 27295
It seems you are running your 2.5 in cygwin, which is probably the reason that it shows up there.
Python 2.5.1 (r251:54863, May 18 2007, 16:56:43)
[GCC 3.4.4 (cygming special, gdc 0.12, using dmd 0.125)] on cygwin
In my 2.5 for win32 it looks just like in your 3.1:
Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import signal
>>> dir(signal)
['NSIG', 'SIGABRT', 'SIGBREAK', 'SIGFPE', 'SIGILL', 'SIGINT', 'SIGSEGV', 'SIGTERM', 'SIG_DFL', 'SIG_IGN', '__doc__', '__
name__', 'default_int_handler', 'getsignal', 'signal']
Upvotes: 3
Reputation: 39548
Windows is NOT posix compliant OS so it does not have all signals - my guess is that on 3.0 the missing signals do not show up there any longer.
Upvotes: 3