Skip to content

Commit d54ca5e

Browse files
alexhenrieandreastt
authored andcommitted
Fix exception messages to reflect the new default log_file behavior
Signed-off-by: Andreas Tolfsen <[email protected]>
1 parent ec062ba commit d54ca5e

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

py/selenium/webdriver/firefox/firefox_binary.py

+6-7
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ def __init__(self, firefox_path=None, log_file=None):
3737
By default, it will be redirected to /dev/null.
3838
"""
3939
self._start_cmd = firefox_path
40+
# We used to default to subprocess.PIPE instead of /dev/null, but after
41+
# a while the pipe would fill up and Firefox would freeze.
4042
self._log_file = log_file or open(os.devnull, "wb")
4143
self.command_line = None
4244
if self._start_cmd is None:
@@ -89,23 +91,20 @@ def _start_from_profile_path(self, path):
8991
command, stdout=self._log_file, stderr=STDOUT,
9092
env=self._firefox_env)
9193

92-
def _get_firefox_output(self):
93-
return self.process.communicate()[0]
94-
9594
def _wait_until_connectable(self):
9695
"""Blocks until the extension is connectable in the firefox."""
9796
count = 0
9897
while not utils.is_connectable(self.profile.port):
9998
if self.process.poll() is not None:
10099
# Browser has exited
101100
raise WebDriverException("The browser appears to have exited "
102-
"before we could connect. The output was: %s" %
103-
self._get_firefox_output())
101+
"before we could connect. If you specified a log_file in "
102+
"the FirefoxBinary constructor, check it for details.")
104103
if count == 30:
105104
self.kill()
106105
raise WebDriverException("Can't load the profile. Profile "
107-
"Dir: %s Firefox output: %s" % (
108-
self.profile.path, self._get_firefox_output()))
106+
"Dir: %s If you specified a log_file in the "
107+
"FirefoxBinary constructor, check it for details.")
109108
count += 1
110109
time.sleep(1)
111110
return True

0 commit comments

Comments
 (0)