New submission from STINNER Victor:

The webbrowser opens almost all browsers in background mode, it looks like only 
Elinks is not opened in this mode.

Problem: the webbrowser doesn't read the exit status of the browser, and so 
create zombi process. On Python 3.6, the subprocess module now emits a 
ResourceWarning in this case (issue #26741).

For example, the following script shows a zombi process ("<defunc>"):
---
import webbrowser, os

b = webbrowser.get("firefox")
b.open("https://bugs.python.org/issue26741";)
b = None

os.system("ps ax|grep firefox")
input("press ENTER when firefox exited")
os.system("ps ax|grep firefox")
---

I guess that Python should use os.fork() somehow to fix this issue.

Another option is to hack the Popen object to not display the warning, but I 
don't think that it's a safe option.

See also the issue #27068 "Add a detach() method to subprocess.Popen", but I 
don't think that it is directly related to background processes run by 
webbrowser.

----------
messages: 265939
nosy: haypo, martin.panter
priority: normal
severity: normal
status: open
title: webbrowser creates zombi processes in the background mode
versions: Python 3.5, Python 3.6

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue27069>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to