Appium-Python-Client 6.0.2__py3-none-any.whl → 6.0.4__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -18,6 +18,7 @@ import subprocess as sp
18
18
  import sys
19
19
  import time
20
20
  from collections.abc import Callable
21
+ from ipaddress import AddressValueError, IPv6Address
21
22
  from typing import Any
22
23
 
23
24
  from selenium.webdriver.remote.remote_connection import urllib3
@@ -318,7 +319,14 @@ def _make_status_path(args: list[str]) -> str:
318
319
 
319
320
 
320
321
  def _make_server_url(args: list[str]) -> str:
321
- return f'{_parse_protocol(args)}://{_parse_host(args)}:{_parse_port(args)}{_make_status_path(args)}'
322
+ host = _parse_host(args)
323
+ try:
324
+ IPv6Address(host)
325
+ except AddressValueError:
326
+ pass
327
+ else:
328
+ host = f'[{host}]'
329
+ return f'{_parse_protocol(args)}://{host}:{_parse_port(args)}{_make_status_path(args)}'
322
330
 
323
331
 
324
332
  if __name__ == '__main__':
@@ -12,6 +12,7 @@
12
12
  # See the License for the specific language governing permissions and
13
13
  # limitations under the License.
14
14
 
15
+ import copy
15
16
  from collections.abc import Callable
16
17
  from typing import TYPE_CHECKING, Any
17
18
 
@@ -318,11 +319,19 @@ class WebDriver(
318
319
  executor = f'{protocol}://{hostname}:{port}{path}'
319
320
 
320
321
  logger.debug('Updated request endpoint to %s', executor)
322
+
321
323
  # Override command executor.
324
+ # The client configuration given by a user, e.g. the read timeout, the proxy or
325
+ # the authentication credentials, must be kept as-is. Only the endpoint the client
326
+ # talks to changes, thus a copy of the current configuration is reused instead of
327
+ # building a brand-new one out of the endpoint URL.
328
+ client_config = copy.copy(self.command_executor.client_config)
329
+ client_config.remote_server_addr = executor
330
+ client_config.keep_alive = keep_alive
322
331
  if isinstance(self.command_executor, AppiumConnection): # type: ignore
323
- self.command_executor = AppiumConnection(executor, keep_alive=keep_alive)
332
+ self.command_executor = AppiumConnection(client_config=client_config)
324
333
  else:
325
- self.command_executor = RemoteConnection(executor, keep_alive=keep_alive)
334
+ self.command_executor = RemoteConnection(client_config=client_config)
326
335
  self._add_commands()
327
336
 
328
337
  # https://github.com/SeleniumHQ/selenium/blob/06fdf2966df6bca47c0ae45e8201cd30db9b9a49/py/selenium/webdriver/remote/webdriver.py#L277
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: Appium-Python-Client
3
- Version: 6.0.2
3
+ Version: 6.0.4
4
4
  Summary: Python client for Appium
5
5
  Project-URL: Homepage, https://appium.io/
6
6
  Project-URL: Repository, https://github.com/appium/python-client
@@ -354,6 +354,10 @@ driver = webdriver.Remote(
354
354
  )
355
355
  ```
356
356
 
357
+ Only the endpoint the client talks to is replaced. The rest of the given `client_config`,
358
+ such as `timeout`, `init_args_for_pool_manager`, proxy, certificates and authentication
359
+ settings, keeps being applied to the requests sent to the direct connect endpoint.
360
+
357
361
  ## Relax SSL validation
358
362
 
359
363
  `strict_ssl` option allows you to send commands to an invalid certificate host like a self-signed one.
@@ -272,7 +272,7 @@ appium/protocols/webdriver/can_execute_scripts.py,sha256=dMRDjreiyV3IJp7-NRUx1Tj
272
272
  appium/protocols/webdriver/can_find_elements.py,sha256=sirq42kVaAnKMbwDDh4CoGIr8B0baEnJQEcJaDpTzmA,1175
273
273
  appium/webdriver/__init__.py,sha256=oT-lIYWpqD562rbXy36HlS03pKfW48BIxqZsqt1XEm0,730
274
274
  appium/webdriver/appium_connection.py,sha256=S-CodDwQWjT-lNwyHSsGtdb4GFHxTM9BXGoOyWdMI94,2405
275
- appium/webdriver/appium_service.py,sha256=LZJ4mlD_1I5iVKi1erRFAqTUf8hHudf7VEgCBGYvTX8,12576
275
+ appium/webdriver/appium_service.py,sha256=K8KUSC1n7z021PvLbTQq1uB2dJEqvGhmOVSjgVFHP3E,12760
276
276
  appium/webdriver/applicationstate.py,sha256=zUPaMt4o4mdAtWP6FapYLJju_tqO6FmMcYFpbFz83dM,735
277
277
  appium/webdriver/client_config.py,sha256=iuVcGsBF9eGNsF_gzs8b6vZWS0iI1u7actaBGBwNrqY,1631
278
278
  appium/webdriver/clipboard_content_type.py,sha256=Tyks8xA2dqvuQGEV4iVYr-iMvB-hsQBEcu8wWBxtJ4M,661
@@ -282,7 +282,7 @@ appium/webdriver/errorhandler.py,sha256=_aT6Qo64ARGch7evG2Uku4-l8wkDaM1R2o06PWXx
282
282
  appium/webdriver/locator_converter.py,sha256=uUdJsX1o0E8x-StcJvO5gFFJbcRzhOmySfgPqJ0UaU4,999
283
283
  appium/webdriver/mobilecommand.py,sha256=B_okscraJMPrN4hSyetSNddkOZ0PyTzsQvBdYHHQqvM,3162
284
284
  appium/webdriver/switch_to.py,sha256=kom9MHNOdZuEG0ALDuaw27NHvtsRDnl-sy_XNAd-Rl4,1174
285
- appium/webdriver/webdriver.py,sha256=OliDZZV2Hu8IrFcRYmSIXMmz-YM43NeyYR87eMnBQfc,18035
285
+ appium/webdriver/webdriver.py,sha256=HmT93aDIabZfbYwi16orubCQGUw9NexWTTLB2YUCYsc,18538
286
286
  appium/webdriver/webelement.py,sha256=U3B2clH3lXHN_cPahNEAIsIaFWJwvrizWYTpQjnSay4,4417
287
287
  appium/webdriver/common/__init__.py,sha256=4MapoJ3p5LiP0AsHMgL2xoPTIFno4dcH1GSoxaZzv4w,623
288
288
  appium/webdriver/common/appiumby.py,sha256=1sFzgJht8v9pO0fG-uK1jgbb8zMJwfBy3LJH15OPqq8,1785
@@ -319,7 +319,7 @@ appium/webdriver/extensions/flutter_integration/__init__.py,sha256=wSUl6yC2TJNla
319
319
  appium/webdriver/extensions/flutter_integration/flutter_commands.py,sha256=FwNqIykRyMAU8-344GTlceBOxLbS-bA9bfGX4iJpHxw,11985
320
320
  appium/webdriver/extensions/flutter_integration/flutter_finder.py,sha256=HH9vGAouJuHzp29Jam_lQGrh67PDq6MxU5Ifewf7C5w,2164
321
321
  appium/webdriver/extensions/flutter_integration/scroll_directions.py,sha256=CkOv7k21SMe-h2-EYSZ6MBKBGTRC1csQ-tuowHgMn0E,85
322
- appium_python_client-6.0.2.dist-info/METADATA,sha256=I6raQ3nZoAMwCLPh69AQLGrsCMNkrhm6R27BD9ViM_4,20932
323
- appium_python_client-6.0.2.dist-info/WHEEL,sha256=zOwg4jB6zX2kU910N-cMawjivD6tO8NEWvE12je1bVk,87
324
- appium_python_client-6.0.2.dist-info/licenses/LICENSE,sha256=QxeKfXNmPWCfFyrXiwdVzMFPFMK0nlBrKhYLUoIcqhk,11384
325
- appium_python_client-6.0.2.dist-info/RECORD,,
322
+ appium_python_client-6.0.4.dist-info/METADATA,sha256=DnOkxjjWxxtTvwiH6b1RX7tpe5C8kwIqvg1tBSb26xs,21194
323
+ appium_python_client-6.0.4.dist-info/WHEEL,sha256=zOwg4jB6zX2kU910N-cMawjivD6tO8NEWvE12je1bVk,87
324
+ appium_python_client-6.0.4.dist-info/licenses/LICENSE,sha256=QxeKfXNmPWCfFyrXiwdVzMFPFMK0nlBrKhYLUoIcqhk,11384
325
+ appium_python_client-6.0.4.dist-info/RECORD,,