Skip to content

Commit ddfb3d8

Browse files
Delta456harsha509diemol
authored
[py] webkitgtk: log_path -> log_output (#14618)
* [py] webkitgtk: log_path -> log_output * apply suggestion * add warning for old para --------- Co-authored-by: Sri Harsha <[email protected]> Co-authored-by: Diego Molina <[email protected]>
1 parent 635a88a commit ddfb3d8

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

py/selenium/webdriver/webkitgtk/service.py

+8-3
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717
import typing
18+
import warnings
1819

1920
from selenium.webdriver.common import service
2021

@@ -28,7 +29,7 @@ class Service(service.Service):
2829
:param executable_path: install path of the WebKitWebDriver executable, defaults to `WebKitWebDriver`.
2930
:param port: Port for the service to run on, defaults to 0 where the operating system will decide.
3031
:param service_args: (Optional) List of args to be passed to the subprocess when launching the executable.
31-
:param log_path: (Optional) File path for the file to be opened and passed as the subprocess stdout/stderr handler.
32+
:param log_output: (Optional) File path for the file to be opened and passed as the subprocess stdout/stderr handler.
3233
:param env: (Optional) Mapping of environment variables for the new process, defaults to `os.environ`.
3334
"""
3435

@@ -37,16 +38,20 @@ def __init__(
3738
executable_path: str = DEFAULT_EXECUTABLE_PATH,
3839
port: int = 0,
3940
log_path: typing.Optional[str] = None,
41+
log_output: typing.Optional[str] = None,
4042
service_args: typing.Optional[typing.List[str]] = None,
4143
env: typing.Optional[typing.Mapping[str, str]] = None,
4244
**kwargs,
4345
) -> None:
4446
self.service_args = service_args or []
45-
log_file = open(log_path, "wb") if log_path else None
47+
if log_path is not None:
48+
warnings.warn("log_path is deprecated, use log_output instead", DeprecationWarning, stacklevel=2)
49+
log_path = open(log_path, "wb")
50+
log_output = open(log_output, "wb") if log_output else None
4651
super().__init__(
4752
executable_path=executable_path,
4853
port=port,
49-
log_file=log_file,
54+
log_output=log_path or log_output,
5055
env=env,
5156
**kwargs,
5257
)

0 commit comments

Comments
 (0)