From 2ca8764621f4a68a9fab0875ee8513f03c708094 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 9 May 2025 13:46:12 +0200 Subject: [PATCH 01/15] build(deps): bump setuptools from 80.0.1 to 80.3.1 (#2843) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 1b76f8759..2dc0a7133 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["setuptools==80.0.1", "setuptools-scm==8.3.1", "wheel==0.45.1", "auditwheel==6.2.0"] +requires = ["setuptools==80.3.1", "setuptools-scm==8.3.1", "wheel==0.45.1", "auditwheel==6.2.0"] build-backend = "setuptools.build_meta" [project] From 871149c7532a495f8bd6c2648c45f42a4e1e980d Mon Sep 17 00:00:00 2001 From: Max Schmitt Date: Mon, 12 May 2025 16:02:04 +0200 Subject: [PATCH 02/15] test: unflake test_context_cookies_should_work test in Edge (#2847) --- tests/async/test_defaultbrowsercontext.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/async/test_defaultbrowsercontext.py b/tests/async/test_defaultbrowsercontext.py index 60f8d83fd..cc42a9c33 100644 --- a/tests/async/test_defaultbrowsercontext.py +++ b/tests/async/test_defaultbrowsercontext.py @@ -78,7 +78,7 @@ async def test_context_cookies_should_work( ) assert document_cookie == "username=John Doe" - assert await page.context.cookies() == [ + assert _filter_cookies(await page.context.cookies()) == [ { "name": "username", "value": "John Doe", From 55b28001dff23c148c68c9f8d9fdc68326a52c4a Mon Sep 17 00:00:00 2001 From: Eli Black Date: Tue, 13 May 2025 01:55:03 +0800 Subject: [PATCH 03/15] chore: more stack-related performance improvements (#2844) --- playwright/_impl/_connection.py | 6 ++---- playwright/_impl/_network.py | 2 +- playwright/_impl/_path_utils.py | 6 ++++-- playwright/_impl/_sync_base.py | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/playwright/_impl/_connection.py b/playwright/_impl/_connection.py index 2d1dad933..1328e7c97 100644 --- a/playwright/_impl/_connection.py +++ b/playwright/_impl/_connection.py @@ -333,7 +333,7 @@ def _send_message_to_server( task = asyncio.current_task(self._loop) callback.stack_trace = cast( traceback.StackSummary, - getattr(task, "__pw_stack_trace__", traceback.extract_stack()), + getattr(task, "__pw_stack_trace__", traceback.extract_stack(limit=10)), ) callback.no_reply = no_reply self._callbacks[id] = callback @@ -387,9 +387,7 @@ def dispatch(self, msg: ParsedMessagePayload) -> None: parsed_error = parse_error( error["error"], format_call_log(msg.get("log")) # type: ignore ) - parsed_error._stack = "".join( - traceback.format_list(callback.stack_trace)[-10:] - ) + parsed_error._stack = "".join(callback.stack_trace.format()) callback.future.set_exception(parsed_error) else: result = self._replace_guids_with_channels(msg.get("result")) diff --git a/playwright/_impl/_network.py b/playwright/_impl/_network.py index 6492c4311..768c22f0c 100644 --- a/playwright/_impl/_network.py +++ b/playwright/_impl/_network.py @@ -530,7 +530,7 @@ async def _race_with_page_close(self, future: Coroutine) -> None: setattr( fut, "__pw_stack__", - getattr(asyncio.current_task(self._loop), "__pw_stack__", inspect.stack()), + getattr(asyncio.current_task(self._loop), "__pw_stack__", inspect.stack(0)), ) target_closed_future = self.request._target_closed_future() await asyncio.wait( diff --git a/playwright/_impl/_path_utils.py b/playwright/_impl/_path_utils.py index 267a82ab0..b405a0675 100644 --- a/playwright/_impl/_path_utils.py +++ b/playwright/_impl/_path_utils.py @@ -14,12 +14,14 @@ import inspect from pathlib import Path +from types import FrameType +from typing import cast def get_file_dirname() -> Path: """Returns the callee (`__file__`) directory name""" - frame = inspect.stack()[1] - module = inspect.getmodule(frame[0]) + frame = cast(FrameType, inspect.currentframe()).f_back + module = inspect.getmodule(frame) assert module assert module.__file__ return Path(module.__file__).parent.absolute() diff --git a/playwright/_impl/_sync_base.py b/playwright/_impl/_sync_base.py index b50c7479d..e6fac9750 100644 --- a/playwright/_impl/_sync_base.py +++ b/playwright/_impl/_sync_base.py @@ -105,8 +105,8 @@ def _sync( g_self = greenlet.getcurrent() task: asyncio.tasks.Task[Any] = self._loop.create_task(coro) - setattr(task, "__pw_stack__", inspect.stack()) - setattr(task, "__pw_stack_trace__", traceback.extract_stack()) + setattr(task, "__pw_stack__", inspect.stack(0)) + setattr(task, "__pw_stack_trace__", traceback.extract_stack(limit=10)) task.add_done_callback(lambda _: g_self.switch()) while not task.done(): From 919701b6628048400ec9c612a6f19a90e8b601bb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 14 May 2025 10:25:07 +0200 Subject: [PATCH 04/15] build(deps): bump pytest-rerunfailures from 15.0 to 15.1 (#2851) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- local-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/local-requirements.txt b/local-requirements.txt index b11ba7896..b3ed62a96 100644 --- a/local-requirements.txt +++ b/local-requirements.txt @@ -12,7 +12,7 @@ pytest==8.3.5 pytest-asyncio==0.26.0 pytest-cov==6.1.1 pytest-repeat==0.9.4 -pytest-rerunfailures==15.0 +pytest-rerunfailures==15.1 pytest-timeout==2.3.1 pytest-xdist==3.6.1 requests==2.32.3 From fc0081acbf004106b504efecd95782f50ea9a029 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 14 May 2025 10:25:52 +0200 Subject: [PATCH 05/15] build(deps): bump setuptools from 80.3.1 to 80.4.0 (#2849) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 2dc0a7133..cad4d18e5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["setuptools==80.3.1", "setuptools-scm==8.3.1", "wheel==0.45.1", "auditwheel==6.2.0"] +requires = ["setuptools==80.4.0", "setuptools-scm==8.3.1", "wheel==0.45.1", "auditwheel==6.2.0"] build-backend = "setuptools.build_meta" [project] From bd4fa2a25c79d77857b9e37172311196a54d0c04 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 14 May 2025 10:25:57 +0200 Subject: [PATCH 06/15] build(deps): bump greenlet from 3.2.1 to 3.2.2 (#2848) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 6c5b7b1c9..28863d0dd 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ # This file was autogenerated by uv via the following command: # uv pip compile pyproject.toml -o requirements.txt -greenlet==3.2.1 +greenlet==3.2.2 # via playwright (pyproject.toml) pyee==13.0.0 # via playwright (pyproject.toml) From 1a6ab165c5e0e7d936f6ddb8ec161d4273d6ce80 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 14 May 2025 12:59:02 +0200 Subject: [PATCH 07/15] build(deps): bump pytest-timeout from 2.3.1 to 2.4.0 (#2850) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- local-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/local-requirements.txt b/local-requirements.txt index b3ed62a96..bb834e828 100644 --- a/local-requirements.txt +++ b/local-requirements.txt @@ -13,7 +13,7 @@ pytest-asyncio==0.26.0 pytest-cov==6.1.1 pytest-repeat==0.9.4 pytest-rerunfailures==15.1 -pytest-timeout==2.3.1 +pytest-timeout==2.4.0 pytest-xdist==3.6.1 requests==2.32.3 service_identity==24.2.0 From 05a45601e9917618ba22f75d0395e9695d98a12a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 20 May 2025 11:48:27 -0700 Subject: [PATCH 08/15] build(deps): bump pyopenssl from 25.0.0 to 25.1.0 (#2862) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- local-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/local-requirements.txt b/local-requirements.txt index bb834e828..6d6bcd552 100644 --- a/local-requirements.txt +++ b/local-requirements.txt @@ -7,7 +7,7 @@ objgraph==3.6.2 Pillow==11.2.1 pixelmatch==0.3.0 pre-commit==3.5.0 -pyOpenSSL==25.0.0 +pyOpenSSL==25.1.0 pytest==8.3.5 pytest-asyncio==0.26.0 pytest-cov==6.1.1 From fc0e73de37c53036c429e432deed15606bda88ef Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 20 May 2025 11:48:41 -0700 Subject: [PATCH 09/15] build(deps): bump types-requests from 2.32.0.20250328 to 2.32.0.20250515 (#2861) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- local-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/local-requirements.txt b/local-requirements.txt index 6d6bcd552..2fc05a12c 100644 --- a/local-requirements.txt +++ b/local-requirements.txt @@ -19,4 +19,4 @@ requests==2.32.3 service_identity==24.2.0 twisted==24.11.0 types-pyOpenSSL==24.1.0.20240722 -types-requests==2.32.0.20250328 +types-requests==2.32.0.20250515 From a2f9320a0c7173d336c272a8f45e4c51ebd535eb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 20 May 2025 11:48:55 -0700 Subject: [PATCH 10/15] build(deps): bump setuptools from 80.4.0 to 80.7.1 (#2860) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index cad4d18e5..0b26f3944 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["setuptools==80.4.0", "setuptools-scm==8.3.1", "wheel==0.45.1", "auditwheel==6.2.0"] +requires = ["setuptools==80.7.1", "setuptools-scm==8.3.1", "wheel==0.45.1", "auditwheel==6.2.0"] build-backend = "setuptools.build_meta" [project] From 3222ef88122b8157c0510c3e51102e3cd6942f71 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 26 May 2025 12:10:30 -0700 Subject: [PATCH 11/15] build(deps): bump setuptools from 80.7.1 to 80.8.0 (#2866) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 0b26f3944..7d72d4778 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["setuptools==80.7.1", "setuptools-scm==8.3.1", "wheel==0.45.1", "auditwheel==6.2.0"] +requires = ["setuptools==80.8.0", "setuptools-scm==8.3.1", "wheel==0.45.1", "auditwheel==6.2.0"] build-backend = "setuptools.build_meta" [project] From b98dd6c0a733d9600888b664d9da320d75a00d0c Mon Sep 17 00:00:00 2001 From: Max Schmitt Date: Tue, 27 May 2025 11:11:27 -0700 Subject: [PATCH 12/15] chore: bump pytest-asyncio to v1.0.0 (#2868) --- local-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/local-requirements.txt b/local-requirements.txt index 2fc05a12c..2e8ddd874 100644 --- a/local-requirements.txt +++ b/local-requirements.txt @@ -9,7 +9,7 @@ pixelmatch==0.3.0 pre-commit==3.5.0 pyOpenSSL==25.1.0 pytest==8.3.5 -pytest-asyncio==0.26.0 +pytest-asyncio==1.0.0 pytest-cov==6.1.1 pytest-repeat==0.9.4 pytest-rerunfailures==15.1 From 398b0bc08a9ac72fdfe24a4eff60dddb9322956b Mon Sep 17 00:00:00 2001 From: campersau Date: Fri, 30 May 2025 17:13:49 +0200 Subject: [PATCH 13/15] fix(docker): set default shell encoding (#2871) --- utils/docker/Dockerfile.jammy | 3 +++ utils/docker/Dockerfile.noble | 3 +++ 2 files changed, 6 insertions(+) diff --git a/utils/docker/Dockerfile.jammy b/utils/docker/Dockerfile.jammy index 8dab1e1d1..7692ad7c5 100644 --- a/utils/docker/Dockerfile.jammy +++ b/utils/docker/Dockerfile.jammy @@ -4,6 +4,9 @@ ARG DEBIAN_FRONTEND=noninteractive ARG TZ=America/Los_Angeles ARG DOCKER_IMAGE_NAME_TEMPLATE="mcr.microsoft.com/playwright/python:v%version%-jammy" +ENV LANG=C.UTF-8 +ENV LC_ALL=C.UTF-8 + # === INSTALL Python === RUN apt-get update && \ diff --git a/utils/docker/Dockerfile.noble b/utils/docker/Dockerfile.noble index 8262bf6a9..2458236a3 100644 --- a/utils/docker/Dockerfile.noble +++ b/utils/docker/Dockerfile.noble @@ -4,6 +4,9 @@ ARG DEBIAN_FRONTEND=noninteractive ARG TZ=America/Los_Angeles ARG DOCKER_IMAGE_NAME_TEMPLATE="mcr.microsoft.com/playwright/python:v%version%-noble" +ENV LANG=C.UTF-8 +ENV LC_ALL=C.UTF-8 + # === INSTALL Python === RUN apt-get update && \ From 3909baf88efa1830ab8a47ab64124e71558cf691 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 3 Jun 2025 08:40:08 +0100 Subject: [PATCH 14/15] build(deps): bump mypy from 1.15.0 to 1.16.0 (#2874) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- local-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/local-requirements.txt b/local-requirements.txt index 2e8ddd874..5183c951e 100644 --- a/local-requirements.txt +++ b/local-requirements.txt @@ -2,7 +2,7 @@ autobahn==23.1.2 black==25.1.0 build==1.2.2.post1 flake8==7.2.0 -mypy==1.15.0 +mypy==1.16.0 objgraph==3.6.2 Pillow==11.2.1 pixelmatch==0.3.0 From 3d964961e9abddd980339bbf6ace7ff0aa34a0e8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 3 Jun 2025 08:40:22 +0100 Subject: [PATCH 15/15] build(deps): bump setuptools from 80.8.0 to 80.9.0 (#2873) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 7d72d4778..1ff674eab 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["setuptools==80.8.0", "setuptools-scm==8.3.1", "wheel==0.45.1", "auditwheel==6.2.0"] +requires = ["setuptools==80.9.0", "setuptools-scm==8.3.1", "wheel==0.45.1", "auditwheel==6.2.0"] build-backend = "setuptools.build_meta" [project]