Skip to content

Commit e01be4a

Browse files
graingertdiemol
andauthored
use subprocess.DEVNULL instead of open(os.devnull) to avoid leaking a… (#13329)
* use subprocess.DEVNULL instead of open(os.devnull) to avoid leaking a file handle * Update py/selenium/webdriver/firefox/firefox_binary.py --------- Co-authored-by: Diego Molina <[email protected]>
1 parent 343aa78 commit e01be4a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

py/selenium/webdriver/firefox/firefox_binary.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import os
2020
import time
2121
from platform import system
22+
from subprocess import DEVNULL
2223
from subprocess import STDOUT
2324
from subprocess import Popen
2425

@@ -41,7 +42,7 @@ def __init__(self, firefox_path=None, log_file=None):
4142
self._start_cmd = firefox_path
4243
# We used to default to subprocess.PIPE instead of /dev/null, but after
4344
# a while the pipe would fill up and Firefox would freeze.
44-
self._log_file = log_file or open(os.devnull, "wb")
45+
self._log_file = log_file or DEVNULL
4546
self.command_line = None
4647
self.platform = system().lower()
4748
if not self._start_cmd:

0 commit comments

Comments
 (0)