Message265939
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. |
|
Date |
User |
Action |
Args |
2016-05-20 12:23:17 | vstinner | set | recipients:
+ vstinner, martin.panter |
2016-05-20 12:23:17 | vstinner | set | messageid: <1463746997.46.0.620771266968.issue27069@psf.upfronthosting.co.za> |
2016-05-20 12:23:17 | vstinner | link | issue27069 messages |
2016-05-20 12:23:17 | vstinner | create | |
|