[issue33603] Subprocess Thread handles grow with each call and aren't released until script ends

2018-05-22 Thread Eryk Sun
Eryk Sun added the comment: The 2nd example with subprocess.run() creates two threads in the Python process, since you're redirecting both stdout and stderr to pipes and run() calls communicate(). The first example with subprocess.Popen() shouldn't create any threads. In

[issue33603] Subprocess Thread handles grow with each call and aren't released until script ends

2018-05-22 Thread GranPrego
GranPrego added the comment: Process explorer is showing the handles as belonging to the python executable. I can see the cmd process start,then the executable which terminates cleanly. I can see thread handles appearing under the python process, with some

[issue33603] Subprocess Thread handles grow with each call and aren't released until script ends

2018-05-22 Thread Antoine Pitrou
Change by Antoine Pitrou : -- nosy: +giampaolo.rodola, gregory.p.smith ___ Python tracker ___

[issue33603] Subprocess Thread handles grow with each call and aren't released until script ends

2018-05-22 Thread Eryk Sun
Eryk Sun added the comment: The thread handle that CreateProcess returns gets immediately closed in Popen._execute_child, so I can't see how this is due to subprocess. Please check to make sure these thread handles aren't for threads in your own process. Set the lower pane

[issue33603] Subprocess Thread handles grow with each call and aren't released until script ends

2018-05-22 Thread GranPrego
New submission from GranPrego : On windows 7 / 10 I'm using subprocess to launch a dos cmdline executable and returning the results, which is all working fine. However, each time I make a call, the Python handle count is gradually increasing, jumping up , back a