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 brian.curtin
Recipients Technologov, andersjm, brian.curtin, christian.heimes, dino.viehland, kap4020, loewis, michael.foord, nnorwitz, tebeka, tim.peters, trent
Date 2010-04-02.21:01:23
SpamBayes Score 4.096057e-12
Marked as misclassified No
Message-id <1270242087.9.0.210083557097.issue1220212@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2010-04-02 21:01:28brian.curtinsetrecipients: + brian.curtin, tim.peters, loewis, nnorwitz, tebeka, andersjm, christian.heimes, kap4020, Technologov, trent, dino.viehland, michael.foord
2010-04-02 21:01:27brian.curtinsetmessageid: <1270242087.9.0.210083557097.issue1220212@psf.upfronthosting.co.za>
2010-04-02 21:01:26brian.curtinlinkissue1220212 messages
2010-04-02 21:01:26brian.curtincreate