From cfd881a99085c9f07f37106e0754c56d0be35ccc Mon Sep 17 00:00:00 2001 From: delta456 Date: Fri, 18 Oct 2024 17:14:31 +0530 Subject: [PATCH 1/3] [py] webkitgtk: log_path -> log_output --- py/selenium/webdriver/webkitgtk/service.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/py/selenium/webdriver/webkitgtk/service.py b/py/selenium/webdriver/webkitgtk/service.py index 92cea26c535f3..b69bd11234ab3 100644 --- a/py/selenium/webdriver/webkitgtk/service.py +++ b/py/selenium/webdriver/webkitgtk/service.py @@ -28,7 +28,7 @@ class Service(service.Service): :param executable_path: install path of the WebKitWebDriver executable, defaults to `WebKitWebDriver`. :param port: Port for the service to run on, defaults to 0 where the operating system will decide. :param service_args: (Optional) List of args to be passed to the subprocess when launching the executable. - :param log_path: (Optional) File path for the file to be opened and passed as the subprocess stdout/stderr handler. + :param log_output: (Optional) File path for the file to be opened and passed as the subprocess stdout/stderr handler. :param env: (Optional) Mapping of environment variables for the new process, defaults to `os.environ`. """ @@ -36,17 +36,17 @@ def __init__( self, executable_path: str = DEFAULT_EXECUTABLE_PATH, port: int = 0, - log_path: typing.Optional[str] = None, + log_output: typing.Optional[str] = None, service_args: typing.Optional[typing.List[str]] = None, env: typing.Optional[typing.Mapping[str, str]] = None, **kwargs, ) -> None: self.service_args = service_args or [] - log_file = open(log_path, "wb") if log_path else None + log_output = open(log_output, "wb") super().__init__( executable_path=executable_path, port=port, - log_file=log_file, + log_output=log_output, env=env, **kwargs, ) From f5046487bb993e4e4a2767912aea6625618ce058 Mon Sep 17 00:00:00 2001 From: delta456 Date: Fri, 18 Oct 2024 17:36:58 +0530 Subject: [PATCH 2/3] apply suggestion --- py/selenium/webdriver/webkitgtk/service.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py/selenium/webdriver/webkitgtk/service.py b/py/selenium/webdriver/webkitgtk/service.py index b69bd11234ab3..d58b929d6b5ae 100644 --- a/py/selenium/webdriver/webkitgtk/service.py +++ b/py/selenium/webdriver/webkitgtk/service.py @@ -42,7 +42,7 @@ def __init__( **kwargs, ) -> None: self.service_args = service_args or [] - log_output = open(log_output, "wb") + log_output = open(log_output, "wb") if log_output else None super().__init__( executable_path=executable_path, port=port, From 6ae3bd42c7ab4632293b9e29d69bf140ed763a1b Mon Sep 17 00:00:00 2001 From: delta456 Date: Mon, 21 Oct 2024 13:23:04 +0530 Subject: [PATCH 3/3] add warning for old para --- py/selenium/webdriver/webkitgtk/service.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/py/selenium/webdriver/webkitgtk/service.py b/py/selenium/webdriver/webkitgtk/service.py index d58b929d6b5ae..5f42d31486143 100644 --- a/py/selenium/webdriver/webkitgtk/service.py +++ b/py/selenium/webdriver/webkitgtk/service.py @@ -15,6 +15,7 @@ # specific language governing permissions and limitations # under the License. import typing +import warnings from selenium.webdriver.common import service @@ -36,17 +37,21 @@ def __init__( self, executable_path: str = DEFAULT_EXECUTABLE_PATH, port: int = 0, + log_path: typing.Optional[str] = None, log_output: typing.Optional[str] = None, service_args: typing.Optional[typing.List[str]] = None, env: typing.Optional[typing.Mapping[str, str]] = None, **kwargs, ) -> None: self.service_args = service_args or [] + if log_path is not None: + warnings.warn("log_path is deprecated, use log_output instead", DeprecationWarning, stacklevel=2) + log_path = open(log_path, "wb") log_output = open(log_output, "wb") if log_output else None super().__init__( executable_path=executable_path, port=port, - log_output=log_output, + log_output=log_path or log_output, env=env, **kwargs, )