[New-bugs-announce] [issue9524] CTRL_C_EVENT and CTRL_BREAK_EVENT cannot be registered by signal.signal() method on windows

Valentine Gogichashvili report at bugs.python.org
Thu Aug 5 20:21:47 CEST 2010


New submission from Valentine Gogichashvili <valgog at gmail.com>:

When executing the following code on Windows 7 64-bit ::

  import sys
  import signal
  import time
  print 'Version:'
  print sys.executable or sys.platform, sys.version
  print
  print

  def h(s, f): print s

  signal.signal(signal.CTRL_BREAK_EVENT, h)

we get the following output::

  Version:
  C:\Python27\python.exe 2.7 (r27:82525, Jul  4 2010, 07:43:08) [MSC       v.1500 64 bit (AMD64)]

  Traceback (most recent call last):
  File "signal_ctrl_break_event.py", line 14, in <module>
    signal.signal(signal.CTRL_BREAK_EVENT, h)
  RuntimeError: (0, 'Error')

When trying to register a handler for a signal.CTRL_C_EVENT the exception is as follows::

  File "signal_ctrl_c_event.py", line 6, in <module>
    signal.signal(signal.CTRL_C_EVENT, h)
  ValueError: signal number out of range

----------
components: Library (Lib), Windows
messages: 113005
nosy: valgog
priority: normal
severity: normal
status: open
title: CTRL_C_EVENT and CTRL_BREAK_EVENT cannot be registered by signal.signal() method on windows
type: behavior
versions: Python 2.7

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue9524>
_______________________________________


More information about the New-bugs-announce mailing list