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

2014-08-28 Thread Akira Li
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

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

2014-08-27 Thread Cristian Consonni
Cristian Consonni added the comment: Hi David, at the moment the other parameters used by the open()[1] - 'new' and 'autoraise' - have no direct mapping to other subprocess.Popen(), they are passed as options to the call for the specific browsers. (e.g. firefox -new-tab

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

2014-08-27 Thread R. David Murray
R. David Murray added the comment: I think it is up to you motivate the reason why the new stdin and stderr parameters should have *different* semantics from the same parameters used with subprocess. Consistency is good, unless there is a specific reason to break consistency. That is, if

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

2014-08-27 Thread Cristian Consonni
Cristian Consonni added the comment: Hi David, *now* I understand your point (!) and, yes, this is something I have thought about. Basically, I was thinking that with this addition I wanted an easy way to suppress stdout/stderr output. I have thought about simply exposing subprocess.Popen's

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

2014-08-27 Thread Cristian Consonni
Cristian Consonni added the comment: After re-reading myself a couple of times I have to say that following subprocess.Popen and adding True and False with the meaning: * True - subprocess inherits file descriptors from the parent process (equivalent to None) * False - /dev/null seems to be a

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

2014-08-27 Thread R. David Murray
R. David Murray added the comment: It makes sense, but I'm not sure avoiding the extra import is sufficient motivation. If you weren't allowing redirection it would be a different story, but allowing redirection seems logical. We should get the opinion of some other developers. I've added

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

2014-08-26 Thread Cristian Consonni
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

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

2014-08-26 Thread R. David Murray
R. David Murray added the comment: This seems like a good idea, based on the use case presented in the stackoverflow question. This would be an enhancement, so it can only go in 3.5. Please submit a patch without the pep 8 changes, so we can easily see what the patch is actually changing.

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

2014-08-26 Thread Cristian Consonni
Cristian Consonni added the comment: Hi David, thanks for your feedback. The parameters' name are indeed stdout and stderr as the one used by subprocess.Popen(). Here's the patch file without the pep 8 modifications. Thanks, Cristian -- Added file:

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

2014-08-26 Thread R. David Murray
R. David Murray added the comment: What I meant was the any *other* value follows the subprocess documentation part. I think it would be better to have *all* the values follow the subprocess documentation. -- ___ Python tracker