[New-bugs-announce] [issue22277] webbrowser.py add parameters to suppress output on stdout and stderr

Cristian Consonni report at bugs.python.org
Tue Aug 26 15:06:36 CEST 2014


New submission from Cristian Consonni:

Hello,

I would like to propose a patch for the webbrowser module to actively suppress any output (both on stdout and stderr) from the module itself.

At the moment, doing a quick internet search, the best approximation to obtain this kind of behavior seems to be the ones described in [1] and [2].

In the patch attached I am proposing to add two optional arguments: stdout and stderr to webbroswer.open() (and to the related webbroswer.open_new() and webbroswer.open_new_tab())

Setting stdout and stderr to None effectively suppress any terminal output. The default (True), mimics the current behavior.

There are other minor modifications to clean the code (PEP8).

I will send a similar patch for Python 2.7.X

Cristian

[1] https://stackoverflow.com/questions/2323080/how-can-i-disable-the-webbrowser-message-in-python
[2] https://stackoverflow.com/questions/1352361/suppress-redirect-stderr-when-calling-python-webrowser

----------
components: Library (Lib)
files: webbrowser.py.patch
keywords: patch
messages: 225915
nosy: CristianCantoro
priority: normal
severity: normal
status: open
title: webbrowser.py add parameters to suppress output on stdout and stderr
type: enhancement
versions: Python 3.4
Added file: http://bugs.python.org/file36477/webbrowser.py.patch

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


More information about the New-bugs-announce mailing list