Skip to content

ValueError: not enough values to unpack (expected 5, got 4) on sb.uc_gui_handle_cf #2937

@moadennagi

Description

@moadennagi

Environment:
Linux ubuntu 22.04
python3.10
seleniumbase==4.28.5

Steps to reproduce
On a fresh install, run the following example the turnstyle example https://seleniumbase.io/help_docs/uc_mode/#uc-mode

from seleniumbase import SB

with SB(uc=True, test=True) as sb:
    url = "https://seleniumbase.io/apps/turnstile"
    sb.uc_open_with_reconnect(url, reconnect_time=2)
    sb.uc_gui_handle_cf()
    sb.assert_element("img#captcha-success", timeout=3)
    sb.set_messenger_theme(location="top_left")
    sb.post_message("SeleniumBase wasn't detected", duration=3)

I get the following error:

Using cached pillow-10.4.0-cp310-cp310-manylinux_2_28_x86_64.whl (4.5 MB)
Installing collected packages: pytweening, python3-Xlib, pyrect, pyperclip, pymsgbox, pygetwindow, Pillow, mouseinfo, pyscreeze, pyautogui
Successfully installed Pillow-10.4.0 mouseinfo-0.1.3 pyautogui-0.9.54 pygetwindow-0.0.9 pymsgbox-1.0.9 pyperclip-1.9.0 pyrect-0.2.0 pyscreeze-0.1.30 python3-Xlib-0.15 pytweening-1.2.0
Traceback (most recent call last):
  File "/home/mennagi/Documents/selenium/.venv/lib/python3.10/site-packages/seleniumbase/plugins/sb_manager.py", line 964, in SB
    yield sb
  File "/home/mennagi/Documents/selenium/turnstyle.py", line 6, in <module>
    sb.uc_gui_handle_cf()
  File "/home/mennagi/Documents/selenium/.venv/lib/python3.10/site-packages/seleniumbase/core/browser_launcher.py", line 4333, in <lambda>
    lambda *args, **kwargs: uc_gui_handle_cf(
  File "/home/mennagi/Documents/selenium/.venv/lib/python3.10/site-packages/seleniumbase/core/browser_launcher.py", line 909, in uc_gui_handle_cf
    import pyautogui
  File "/home/mennagi/Documents/selenium/.venv/lib/python3.10/site-packages/pyautogui/__init__.py", line 246, in <module>
    import mouseinfo
  File "/home/mennagi/Documents/selenium/.venv/lib/python3.10/site-packages/mouseinfo/__init__.py", line 223, in <module>
    _display = Display(os.environ['DISPLAY'])
  File "/home/mennagi/Documents/selenium/.venv/lib/python3.10/site-packages/Xlib/display.py", line 89, in __init__
    # Translations for keysyms to strings.
  File "/home/mennagi/Documents/selenium/.venv/lib/python3.10/site-packages/Xlib/display.py", line 71, in __init__
    # don't cache NONE responses in case someone creates this later
  File "/home/mennagi/Documents/selenium/.venv/lib/python3.10/site-packages/Xlib/protocol/display.py", line 84, in __init__
    self.send_active = 0
ValueError: not enough values to unpack (expected 5, got 4)

The issue only happens the first time I run the example, the example runs ok afterwards

Metadata

Metadata

Assignees

No one assigned

    Labels

    UC Mode / CDP ModeUndetected Chromedriver Mode / CDP Modecan't reproduceWe tried to see what you saw, but didn't

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions