On Ubuntu 24.04 LTS that defaults to Wayland, trying to paste to TextInput widget fails silently on line 1293.
The reason for this was that as per Pyperclip, one of the packets in xclip, xsel, or wl-clipboard was missing. Of these at least wl-clipboard works, I didn't test others.
Solution:
Perhaps the library could try to detect the platform and either print a warning, or raise an exception when this happens. E.g.
# Paste text in cursor
try:
text = paste()
except PyperclipException:
import os
if os.getenv("XDG_SESSION_TYPE") == 'wayland':
raise PyperclipException("Pasting from clipboard failed. Please install package 'wl-clipboard'")
return False
Problem:
On Ubuntu 24.04 LTS that defaults to Wayland, trying to paste to TextInput widget fails silently on line 1293.
The reason for this was that as per Pyperclip, one of the packets in
xclip
,xsel
, orwl-clipboard
was missing. Of these at leastwl-clipboard
works, I didn't test others.Solution:
Perhaps the library could try to detect the platform and either print a warning, or raise an exception when this happens. E.g.