Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions local-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@ 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
pre-commit==3.5.0
pyOpenSSL==25.0.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.0
pytest-timeout==2.3.1
pytest-rerunfailures==15.1
pytest-timeout==2.4.0
pytest-xdist==3.6.1
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
6 changes: 2 additions & 4 deletions playwright/_impl/_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"))
Expand Down
2 changes: 1 addition & 1 deletion playwright/_impl/_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
6 changes: 4 additions & 2 deletions playwright/_impl/_path_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
4 changes: 2 additions & 2 deletions playwright/_impl/_sync_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -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.9.0", "setuptools-scm==8.3.1", "wheel==0.45.1", "auditwheel==6.2.0"]
build-backend = "setuptools.build_meta"

[project]
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
2 changes: 1 addition & 1 deletion tests/async/test_defaultbrowsercontext.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
3 changes: 3 additions & 0 deletions utils/docker/Dockerfile.jammy
Original file line number Diff line number Diff line change
Expand Up @@ -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 && \
Expand Down
3 changes: 3 additions & 0 deletions utils/docker/Dockerfile.noble
Original file line number Diff line number Diff line change
Expand Up @@ -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 && \
Expand Down