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.

Author vstinner
Recipients vstinner
Date 2016-05-20.10:19:44
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1463739584.18.0.0161123331788.issue27068@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2016-05-20 10:19:44vstinnersetrecipients: + vstinner
2016-05-20 10:19:44vstinnersetmessageid: <1463739584.18.0.0161123331788.issue27068@psf.upfronthosting.co.za>
2016-05-20 10:19:44vstinnerlinkissue27068 messages
2016-05-20 10:19:44vstinnercreate