[issue27068] Add a detach() method to subprocess.Popen

STINNER Victor report at bugs.python.org
Fri May 20 06:19:44 EDT 2016


New submission from STINNER Victor:

The issue #26741 modified the subprocess.Popen destructor to emit a ResourceWarning if the child process is still running.

According to Martin Panter, it can be deliberate to let the subprocess running if the management of the subprocess is delegated to a different object. I'm not convinced that it's safe to do that, but I chose to open this issue to discuss the feature.

My fear is that subprocess.Popen handles many private objects required by the subprocess, not only its pid. For example, on Windows Popen stores the handle of the subprocess. Popen also contains pipe objects when stdin, stdout and/or stderr is redirected.

I guess that detach() makes sense when the developer knows what he/she is doing and knows how to handle all resources attached to a subprocess.

----------
components: Library (Lib)
messages: 265929
nosy: haypo
priority: normal
severity: normal
status: open
title: Add a detach() method to subprocess.Popen
type: enhancement
versions: Python 3.6

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue27068>
_______________________________________


More information about the Python-bugs-list mailing list