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.

classification
Title: Support CREATE_SUSPENDED flag in subprocess.py for Win32
Type: Stage:
Components: Extension Modules Versions:
process
Status: closed Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: chrisheller, jorend, sf-robot
Priority: normal Keywords: patch

Created on 2007-03-10 00:33 by chrisheller, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
subprocess.CREATE_SUSPENDED.patch chrisheller, 2007-03-10 00:33 Patch to add needed functionality
Messages (3)
msg52141 - (view) Author: Chris Heller (chrisheller) Date: 2007-03-10 00:33
The CreateProcess() function that subprocess uses on Windows allows for creation of processes in a suspended state. 

To then start the process running though you need to call ResumeThread on the primary thread of the process. Currently this thread handle gets closed, then discarded by the subprocess module. 

In order to continue making use of subprocess, but also use the CREATE_SUSPENDED flag, I modified my local copy of subprocess to retain the thread when the CREATE_SUSPENDED flag was supplied. 

If the CREATE_SUSPENDED flag is not requested, then the code behaves exactly the same as it currently does. 

The attached patch is against Subversion trunk, revision 53646. 
msg52142 - (view) Author: Jason Orendorff (jorend) Date: 2007-03-10 03:50
This patch doesn't work.  Three bugs: (1) bad syntax, && should be & (2) global name CREATE_SUSPENDED isn't defined; and (3) after the if statement, ht.Close() happens anyway.

msg52143 - (view) Author: SourceForge Robot (sf-robot) Date: 2007-03-25 02:20
This Tracker item was closed automatically by the system. It was
previously set to a Pending status, and the original submitter
did not respond within 14 days (the time period specified by
the administrator of this Tracker).
History
Date User Action Args
2022-04-11 14:56:23adminsetgithub: 44688
2007-03-10 00:33:02chrishellercreate