You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
new_get_auth() fails to authenticate against Xauthority entries with an empty display number under Wayland/XWayland #294
So, I am a human/programmer. But this bug/report was found/written by ChatGPT. What ChatGPT did fixed my issue so my current understanding is it is legitimate. But, its somewhat over my head. You have my sincere apology for wasting your time if this is actually bogus.
Environment
Ubuntu 26.04 LTS
Wayland session with XWayland
Python 3.14.x
python-xlib 0.33
DISPLAY=:0
Xauthority file provided by Mutter/XWayland via $XAUTHORITY
Description
python-xlib is unable to connect to the local XWayland display because new_get_auth() does not find the authentication entry in the Xauthority file.
The Xauthority file contains entries whose display-number field is empty:
However, unix_connect.new_get_auth() ultimately calls Xauthority.get_best_auth() with display number 0, which is converted to b'0'. Consequently, the entries with num=b'' are not matched and new_get_auth() returns empty authentication credentials.
The result is:
Xlib.error.DisplayConnectionError:
Can't connect to display ":0":
b'Authorization required, but no authorization protocol specified'
The old xauth-based authentication path is able to locate the cookie:
old_get_auth(...)
returns the correct MIT-MAGIC-COOKIE-1 cookie, but the implementation in that path converts the hexadecimal cookie to a Python str rather than raw bytes. Using bytes.fromhex() instead allows the Xlib connection to succeed:
This appears closely related to the problem described above, but the problem is still reproducible with python-xlib 0.33 on this system.
I am therefore wondering whether this is an unhandled variant of the no-display-number case, or whether the 0.32 fix does not apply to Xauthority files generated by Mutter/XWayland.
The actual Xauthority cookie is omitted from this report.
Activity