Package: python3-playwright
Version: 1.55.0+ds-2
Severity: serious
X-Debbugs-Cc: [email protected]

Hi,
I believe that the current python3-playwright is not usable because the
node-playwright version is too old.

Running a simple test

$ cat test.py
from playwright.sync_api import sync_playwright

with sync_playwright() as p:
    browser = p.chromium.launch(headless=True)
    page = browser.new_page()
    page.goto("https://example.com";)
    print(page.title())
    browser.close()

results in

$ python3 test.py 
Traceback (most recent call last):
  File "/build/test.py", line 3, in <module>
    with sync_playwright() as p:
         ~~~~~~~~~~~~~~~^^
  File 
"/usr/lib/python3/dist-packages/playwright/sync_api/_context_manager.py", line 
77, in __enter__
    dispatcher_fiber.switch()
    ~~~~~~~~~~~~~~~~~~~~~~~^^
  File 
"/usr/lib/python3/dist-packages/playwright/sync_api/_context_manager.py", line 
56, in greenlet_main
    self._loop.run_until_complete(self._connection.run_as_sync())
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.13/asyncio/base_events.py", line 725, in 
run_until_complete
    return future.result()
           ~~~~~~~~~~~~~^^
  File "/usr/lib/python3/dist-packages/playwright/_impl/_connection.py", line 
301, in run_as_sync
    await self.run()
  File "/usr/lib/python3/dist-packages/playwright/_impl/_connection.py", line 
312, in run
    await self._transport.run()
  File "/usr/lib/python3/dist-packages/playwright/_impl/_transport.py", line 
161, in run
    self.on_message(obj)
    ~~~~~~~~~~~~~~~^^^^^
  File "/usr/lib/python3/dist-packages/playwright/_impl/_connection.py", line 
271, in <lambda>
    self._transport.on_message = lambda msg: self.dispatch(msg)
                                             ~~~~~~~~~~~~~^^^^^
  File "/usr/lib/python3/dist-packages/playwright/_impl/_connection.py", line 
437, in dispatch
    self._create_remote_object(
    ~~~~~~~~~~~~~~~~~~~~~~~~~~^
        parent, params["type"], params["guid"], params["initializer"]
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/usr/lib/python3/dist-packages/playwright/_impl/_connection.py", line 
503, in _create_remote_object
    result = self._object_factory(parent, type, guid, initializer)
  File "/usr/lib/python3/dist-packages/playwright/_impl/_object_factory.py", 
line 76, in create_remote_object
    local_utils = LocalUtils(parent, type, guid, initializer)
  File "/usr/lib/python3/dist-packages/playwright/_impl/_local_utils.py", line 
30, in __init__
    for device in initializer["deviceDescriptors"]
                  ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^
KeyError: 'deviceDescriptors'
Task was destroyed but it is pending!
task: <Task pending name='Task-3' coro=<Connection.run.<locals>.init() running 
at /usr/lib/python3/dist-packages/playwright/_impl/_connection.py:308> 
wait_for=<Future pending cb=[Task.task_wakeup()]> 
cb=[ProtocolCallback.__init__.<locals>.cb() at 
/usr/lib/python3/dist-packages/playwright/_impl/_connection.py:228]>


which upstream says is associated to a version mismatch
https://github.com/microsoft/playwright-python/issues/2130

Unfortunately the node package is very out of date, see Bug #1121651, but I have
no experience with javascript packaging to be able to help.

See also Bug #1121984.

-- System Information:
Debian Release: forky/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 6.18.9+deb14-amd64 (SMP w/8 CPU threads; PREEMPT)
Locale: LANG=C, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: unable to detect

Versions of packages python3-playwright depends on:
ii  python3           3.13.9-3
ii  python3-greenlet  3.2.4-3
ii  python3-pyee      13.0.0-2

python3-playwright recommends no packages.

python3-playwright suggests no packages.

-- no debconf information

Reply via email to