Brian Curtin <cur...@acm.org> added the comment:

Michael, do you have an example of something which returns a handle? This 
current patch doesn't work with handles, but it wouldn't be hard to add it. I 
could make it work with the _handle object of a Popen object, but you could 
just as easily call os.kill on the pid of the Popen object. I don't know of any 
Python-wide handle object...I know subprocess has it's own, and don't really 
know what other functions are returning handles.


Anyways, this patch includes an additional test script which uses ctypes to 
setup a console control handler, and CTRL_BREAK_EVENT is tested successfully. 
However, CTRL_C_EVENT is not. See 
http://msdn.microsoft.com/en-us/library/ms686016%28v=VS.85%29.aspx for details, 
but I'm not able to get the subprocess to work with CTRL+C. Calling 
SetConsoleCtrlHandler(NULL, FALSE) either in the script, test_os, or in 
_subprocess.c does not change anything, although it seems that it should. The 
CTRL_C_EVENT test is currently skipped in the patch until I can figure that out.

----------
nosy: +dino.viehland
Added file: http://bugs.python.org/file16739/issue1220212.patch

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue1220212>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to