Skip to content
2 changes: 1 addition & 1 deletion playwright/_impl/_browser_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ def _user_data_dir(self, userDataDir: Optional[Union[str, Path]]) -> str:
# Can be dropped once we drop Python 3.9 support (10/2025):
# https://github.com/python/cpython/issues/82852
if sys.platform == "win32" and sys.version_info[:2] < (3, 10):
return pathlib.Path.cwd() / userDataDir
return str(pathlib.Path.cwd() / userDataDir)
return str(Path(userDataDir).resolve())
return str(Path(userDataDir))

Expand Down
12 changes: 12 additions & 0 deletions tests/common/test_signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@
def _test_signals_async(
browser_name: str, launch_arguments: Dict, wait_queue: "multiprocessing.Queue[str]"
) -> None:
# On Windows, hint to mypy and pyright that they shouldn't check this function
if sys.platform == "win32":
return

os.setpgrp()
sigint_received = False

Expand Down Expand Up @@ -67,6 +71,10 @@ async def main() -> None:
def _test_signals_sync(
browser_name: str, launch_arguments: Dict, wait_queue: "multiprocessing.Queue[str]"
) -> None:
# On Windows, hint to mypy and pyright that they shouldn't check this function
if sys.platform == "win32":
return

os.setpgrp()
sigint_received = False

Expand Down Expand Up @@ -103,6 +111,10 @@ def my_sig_handler(signum: int, frame: Any) -> None:
def _create_signals_test(
target: Any, browser_name: str, launch_arguments: Dict
) -> None:
# On Windows, hint to mypy and pyright that they shouldn't check this function
if sys.platform == "win32":
return

wait_queue: "multiprocessing.Queue[str]" = multiprocessing.Queue()
process = multiprocessing.Process(
target=target, args=[browser_name, launch_arguments, wait_queue]
Expand Down
Loading