[issue22277] webbrowser.py add parameters to suppress output on stdout and stderr

Akira Li report at bugs.python.org
Thu Aug 28 18:16:58 CEST 2014


Akira Li added the comment:

open(url, stdout=DEVNULL) won't work on Windows (os.startfile()) and OS
X (AppleScript) by default.

UnixBrowser already suppresses the output when it is safe, if
self.redirect_stdout=True and self.background=True are set.

Also, open(url, stdout=DEVNULL) would probably break text-browsers such
as elinks (e.g., they are run when $DISPLAY environment variable is not set).

What left: Unix browsers for which webbrowser doesn't think that it is
safe to suppress the output. If webbrowser allows the output when it
shouldn't then it could be fixed on case by case basis and/or maybe some
mechanism could be provided to override the webbrowser choice e.g.,
BaseBrowser.suppress_output attribute that defaults to None (let
webbrowser decide).

webbrowser is a high-level interface; stdout/stderr from subprocess are
too low-level for open() function (inventing your own stdout/stderr
values is even worse).

----------
nosy: +akira

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue22277>
_______________________________________


More information about the Python-bugs-list mailing list