[Python-checkins] r79633 - in python/trunk: Doc/library/os.rst Doc/library/signal.rst Doc/library/subprocess.rst Lib/subprocess.py Lib/test/test_os.py Lib/test/win_console_handler.py Lib/unittest/test/test_break.py Modules/posixmodule.c Modules/s

Brian Curtin brian.curtin at gmail.com
Tue Apr 20 17:30:12 CEST 2010


On Tue, Apr 20, 2010 at 05:35, Ezio Melotti <ezio.melotti at gmail.com> wrote:

> On 03/04/2010 2.26, brian.curtin wrote:
>
>> Author: brian.curtin
>> Date: Sat Apr  3 01:26:06 2010
>> New Revision: 79633
>>
>> Log:
>> Implement #1220212. Add os.kill support for Windows.
>>
>> os.kill takes one of two newly added signals, CTRL_C_EVENT and
>> CTRL_BREAK_EVENT, or any integer value. The events are a special case
>> which work with subprocess console applications which implement a
>> special console control handler. Any other value but those two will
>> cause os.kill to use TerminateProcess, outright killing the process.
>>
>> This change adds win_console_handler.py, which is a script to implement
>> SetConsoleCtrlHandler and applicable handler function, using ctypes.
>>
>> subprocess also gets another attribute which is a necessary flag to
>> creationflags in Popen in order to send the CTRL events.
>>
>>
>> Added:
>>    python/trunk/Lib/test/win_console_handler.py
>> Modified:
>>    python/trunk/Doc/library/os.rst
>>    python/trunk/Doc/library/signal.rst
>>    python/trunk/Doc/library/subprocess.rst
>>    python/trunk/Lib/subprocess.py
>>    python/trunk/Lib/test/test_os.py
>>    python/trunk/Lib/unittest/test/test_break.py
>>    python/trunk/Modules/posixmodule.c
>>    python/trunk/Modules/signalmodule.c
>>    python/trunk/PC/_subprocess.c
>>
>> Modified: python/trunk/Doc/library/os.rst
>>
>> ==============================================================================
>> --- python/trunk/Doc/library/os.rst     (original)
>> +++ python/trunk/Doc/library/os.rst     Sat Apr  3 01:26:06 2010
>> @@ -1719,7 +1719,14 @@
>>
>>     Send signal *sig* to the process *pid*.  Constants for the specific
>> signals
>>     available on the host platform are defined in the :mod:`signal`
>> module.
>> -   Availability: Unix.
>> +
>> +   Windows: The :data:`signal.CTRL_C_EVENT` and
>> +   :data:`signal.CTRL_BREAK_EVENT` signals are special signals which can
>> +   only be sent to console processes which share a common console window,
>> +   e.g., some subprocesses. Any other value for *sig* will cause the
>> process
>> +   to be unconditionally killed by the TerminateProcess API, and the exit
>> code
>> +   will be set to *sig*. The Windows version of :func:`kill` additionally
>> takes
>> +   process handles to be killed.
>>
>>
>>  .. function:: killpg(pgid, sig)
>>
>> Modified: python/trunk/Doc/library/signal.rst
>>
>> ==============================================================================
>> --- python/trunk/Doc/library/signal.rst (original)
>> +++ python/trunk/Doc/library/signal.rst Sat Apr  3 01:26:06 2010
>> @@ -75,6 +75,20 @@
>>     the system are defined by this module.
>>
>>
>> +.. data:: CTRL_C_EVENT
>> +
>> +   The signal corresponding to the CTRL+C keystroke event.
>> +
>> +   Availability: Windows.
>> +
>> +
>> +.. data:: CTRL_BREAK_EVENT
>> +
>> +   The signal corresponding to the CTRL+BREAK keystroke event.
>> +
>> +   Availability: Windows.
>> +
>> +
>> [...]
>>
>>
> Hi,
> shouldn't these have a versionadded?
>
> Best Regards,
> Ezio Melotti <http://mail.python.org/mailman/listinfo/python-checkins>
>

Fixed in r80265 and 80266.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-checkins/attachments/20100420/34436d68/attachment.html>


More information about the Python-checkins mailing list