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 martin.panter, vstinner
Date 2016-05-20.12:23:17
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1463746997.46.0.620771266968.issue27069@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2016-05-20 12:23:17vstinnersetrecipients: + vstinner, martin.panter
2016-05-20 12:23:17vstinnersetmessageid: <1463746997.46.0.620771266968.issue27069@psf.upfronthosting.co.za>
2016-05-20 12:23:17vstinnerlinkissue27069 messages
2016-05-20 12:23:17vstinnercreate