Skip to content

Commit b24467b

Browse files
alexhenrielukeis
authored andcommitted
Redirect Firefox output to /dev/null by default
Because the Firefox output is never used by default, /dev/null is the perfect place for it. Fixes Issue #7677 Signed-off-by: Luke Inman-Semerau <luke.semerau@gmail.com>
1 parent 426c1ba commit b24467b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

py/selenium/webdriver/firefox/firefox_binary.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
import os
1818
import platform
19-
from subprocess import Popen, PIPE, STDOUT
19+
from subprocess import Popen, STDOUT
2020
from selenium.common.exceptions import WebDriverException
2121
from selenium.webdriver.common import utils
2222
import time
@@ -34,10 +34,10 @@ def __init__(self, firefox_path=None, log_file=None):
3434
- firefox_path - Path to the Firefox executable. By default, it will be detected from the standard locations.
3535
- log_file - A file object to redirect the firefox process output to. It can be sys.stdout.
3636
Please note that with parallel run the output won't be synchronous.
37-
By default, it will be redirected to subprocess.PIPE.
37+
By default, it will be redirected to /dev/null.
3838
"""
3939
self._start_cmd = firefox_path
40-
self._log_file = log_file or PIPE
40+
self._log_file = log_file or open(os.devnull, "wb")
4141
self.command_line = None
4242
if self._start_cmd is None:
4343
self._start_cmd = self._get_firefox_start_cmd()

0 commit comments

Comments
 (0)