@@ -37,6 +37,8 @@ def __init__(self, firefox_path=None, log_file=None):
37
37
By default, it will be redirected to /dev/null.
38
38
"""
39
39
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.
40
42
self ._log_file = log_file or open (os .devnull , "wb" )
41
43
self .command_line = None
42
44
if self ._start_cmd is None :
@@ -89,23 +91,20 @@ def _start_from_profile_path(self, path):
89
91
command , stdout = self ._log_file , stderr = STDOUT ,
90
92
env = self ._firefox_env )
91
93
92
- def _get_firefox_output (self ):
93
- return self .process .communicate ()[0 ]
94
-
95
94
def _wait_until_connectable (self ):
96
95
"""Blocks until the extension is connectable in the firefox."""
97
96
count = 0
98
97
while not utils .is_connectable (self .profile .port ):
99
98
if self .process .poll () is not None :
100
99
# Browser has exited
101
100
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." )
104
103
if count == 30 :
105
104
self .kill ()
106
105
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." )
109
108
count += 1
110
109
time .sleep (1 )
111
110
return True
0 commit comments