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

Eryk Sun report at bugs.python.org
Tue May 22 14:57:01 EDT 2018


Eryk Sun <eryksun at gmail.com> 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 either case, nothing in subprocess should be opening a handle for a thread.

Please attach a minimal script that reproduces the problem, preferably running a command everyone can test such as "python.exe -V" and preferably with shell=False if the problem can be reproduced without the shell. Also, describe your Python setup, i.e. the installed distribution and packages. Something could be monkey patching the subprocess module.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue33603>
_______________________________________


More information about the Python-bugs-list mailing list