[issue26741] subprocess.Popen should emit a ResourceWarning in destructor if the process is still running

2017-01-06 Thread Roundup Robot
Roundup Robot added the comment: New changeset b14a1e81c34a by Victor Stinner in branch '3.6': Fix subprocess.Popen.__del__() fox Python shutdown https://hg.python.org/cpython/rev/b14a1e81c34a -- ___ Python tracker

[issue26741] subprocess.Popen should emit a ResourceWarning in destructor if the process is still running

2016-08-17 Thread STINNER Victor
STINNER Victor added the comment: Oops, I forget to close the issue. -- resolution: -> fixed status: open -> closed ___ Python tracker ___

[issue26741] subprocess.Popen should emit a ResourceWarning in destructor if the process is still running

2016-08-12 Thread Martin Panter
Martin Panter added the comment: No super important reason, just to avoid indenting the code. This is a medium-sized test function, with a few long lines already. And if you keep the indentation the same, it makes it easier to port other changes to Python 2, look through the repository

[issue26741] subprocess.Popen should emit a ResourceWarning in destructor if the process is still running

2016-08-12 Thread STINNER Victor
STINNER Victor added the comment: Martin: why don't you use "with"? -- ___ Python tracker ___ ___

[issue26741] subprocess.Popen should emit a ResourceWarning in destructor if the process is still running

2016-08-12 Thread Roundup Robot
Roundup Robot added the comment: New changeset f78a682a3515 by Martin Panter in branch '3.5': Issue #26741: Clean up subprocess.Popen object in test_poll https://hg.python.org/cpython/rev/f78a682a3515 New changeset 7ff3ce0dfd45 by Martin Panter in branch 'default': Issue #26741: Merge

[issue26741] subprocess.Popen should emit a ResourceWarning in destructor if the process is still running

2016-05-20 Thread STINNER Victor
STINNER Victor added the comment: > At this point, the Python interpreter has a child process “chromium” which is > left as a zombie when it exits. The new ResourceWarning is the confirmation that there is an issue. Creating a zombi process is not a good idea :-) I opened the issue #27069 to

[issue26741] subprocess.Popen should emit a ResourceWarning in destructor if the process is still running

2016-05-20 Thread Martin Panter
Martin Panter added the comment: I tried out your code on the webbrowser module, and it does raise a warning: >>> import webbrowser >>> b = webbrowser.get("chromium") >>> b.open("https://bugs.python.org/issue26741;) /home/proj/python/cpython/Lib/subprocess.py:1011: ResourceWarning: running

[issue26741] subprocess.Popen should emit a ResourceWarning in destructor if the process is still running

2016-05-20 Thread STINNER Victor
Changes by STINNER Victor : -- resolution: fixed -> status: closed -> open ___ Python tracker ___

[issue26741] subprocess.Popen should emit a ResourceWarning in destructor if the process is still running

2016-05-20 Thread Roundup Robot
Roundup Robot added the comment: New changeset 72946937536e by Victor Stinner in branch '3.5': asyncio: fix ResourceWarning related to subprocesses https://hg.python.org/cpython/rev/72946937536e New changeset 911f398c6396 by Victor Stinner in branch 'default': Merge 3.5 (issue #26741)

[issue26741] subprocess.Popen should emit a ResourceWarning in destructor if the process is still running

2016-05-20 Thread STINNER Victor
STINNER Victor added the comment: Martin Panter: > I think the basic idea of adding the warning is good. Cool. I pushed an enhanced version of my patch: * I fixed _execute_child() to set correctly the returncode attribute * I splitted the patch into multiple commits and I documented the doc *

[issue26741] subprocess.Popen should emit a ResourceWarning in destructor if the process is still running

2016-05-20 Thread Roundup Robot
Roundup Robot added the comment: New changeset b122011b139e by Victor Stinner in branch 'default': Use "with popen:" in test_subprocess https://hg.python.org/cpython/rev/b122011b139e New changeset 4c02b983bd5f by Victor Stinner in branch 'default': Issue #26741: POSIX implementation of

[issue26741] subprocess.Popen should emit a ResourceWarning in destructor if the process is still running

2016-04-12 Thread Martin Panter
Martin Panter added the comment: I think the basic idea of adding the warning is good. I think this might be a bit like open(closefd=True) and socket.detach(). Normally, it is a bug not to close a file or socket, but the API is flexible and has a way to bypass this. Perhaps the term “daemon”

[issue26741] subprocess.Popen should emit a ResourceWarning in destructor if the process is still running

2016-04-12 Thread STINNER Victor
STINNER Victor added the comment: > One potential problem is how to provide for people who really want to let the > child continue to run in the background or as a daemon without waiting for > it, even if the parent exits. Perhaps a special method proc.detach() or > whatever? Maybe my

[issue26741] subprocess.Popen should emit a ResourceWarning in destructor if the process is still running

2016-04-12 Thread STINNER Victor
STINNER Victor added the comment: > Did you forget to send the patch? Right :-) -- keywords: +patch Added file: http://bugs.python.org/file42448/subprocess_res_warn.patch ___ Python tracker

[issue26741] subprocess.Popen should emit a ResourceWarning in destructor if the process is still running

2016-04-12 Thread Martin Panter
Martin Panter added the comment: Did you forget to send the patch? One potential problem is how to provide for people who really want to let the child continue to run in the background or as a daemon without waiting for it, even if the parent exits. Perhaps a special method proc.detach() or

[issue26741] subprocess.Popen should emit a ResourceWarning in destructor if the process is still running

2016-04-12 Thread STINNER Victor
New submission from STINNER Victor: A subprocess.Popen object contains many resources: pipes, a child process (its pid, and an handle on Windows), etc. IMHO it's not safe to rely on the destructor to release all resources. I would prefer to release resources explicitly. For example, use