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

2017-11-23 Thread STINNER Victor
STINNER Victor added the comment: Sorry, but I'm not sure that it's a good idea to add a detach() method. It's hard to follow who owns all resources attached to a process, not only it's pid, but also streams which may be buffered. I propose the close the issue. The

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

2017-07-08 Thread Martin Panter
Martin Panter added the comment: Personally, I haven’t needed this feature. But I still think it may be a decent solution for the “webbrowser” module, potentially your “asyncio” problem, and other cases that could now trigger an unwanted ResourceWarning. --

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

2017-06-27 Thread STINNER Victor
STINNER Victor added the comment: @Martin Panter: Do you still want this feature? Any progress on bpo-27069? -- ___ Python tracker ___

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

2017-01-07 Thread Martin Panter
Martin Panter added the comment: The user can access pipes and close them directly, or keep their own reference. I don’t think detach() should touch pipes, and __exit__() should probably continue to close them. Maybe call the method detach_pid() if that makes it clearer that pipes are

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

2016-05-20 Thread Martin Panter
Martin Panter added the comment: In this example, I think we want to drop the zombie so the “init” process will call wait() on it. My pseudocode is similar to your fork() suggestion in Issue 27069. Fork returns the child’s PID, but we would ignore the PID and exit the intermediate parent

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

2016-05-20 Thread STINNER Victor
STINNER Victor added the comment: Martin Panter: > One potential way to fix Issue 27069 (leave a webbrowser running in the > background) might be to use a detach() method. Pseudocode: Your code is a workaround to hide the warning, it doesn't fix the bug (creating a zombi process). --

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

2016-05-20 Thread Martin Panter
Martin Panter added the comment: One potential way to fix Issue 27069 (leave a webbrowser running in the background) might be to use a detach() method. Pseudocode: launcher = """\ import subprocess, sys proc = subprocess.Popen(sys.argv) # Popen object gives up “ownership” of child. # Caller

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

2016-05-20 Thread STINNER Victor
STINNER Victor added the comment: Hum, I had to patch asyncio to avoid a ResourceWarning because asyncio polls the status of the child process using a child watcher, whereas the Popen object is not aware of the child watcher: New changeset 72946937536e by Victor Stinner in branch '3.5':

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

2016-05-20 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +martin.panter ___ Python tracker ___ ___

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

2016-05-20 Thread STINNER Victor
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