New submission from STINNER Victor <vstin...@redhat.com>:

subprocess.Popen uses _winapi.CreateProcess() to spawn a child process. It 
stores the process handle using a Handle class. Popen never explicitly releases 
the handle, it rely on Handle.__del__ when the Popen object is detroyed (when 
Popen._handle attribute is cleared).

As discussed in bpo-37380, we could call explicitly CloseHandle(handle) as soon 
as the child process completes, to release resources in the Windows kernel.

Attached PR implements this fix.

----------
components: Library (Lib)
messages: 346603
nosy: vstinner
priority: normal
severity: normal
status: open
title: [Windows] subprocess: close the handle when the process completes
type: resource usage
versions: Python 3.9

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

Reply via email to