From 5134a30d42974358f2a0f2bbd2d81d4b5db1d7e6 Mon Sep 17 00:00:00 2001 From: Nicola Guerrera Date: Mon, 22 Jan 2024 12:07:21 +0100 Subject: [PATCH] wayland: request text type to wl-paste This fixes UnicodeDecodeError while the clipboards contains images or other types of content --- src/pyperclip/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pyperclip/__init__.py b/src/pyperclip/__init__.py index 300c9ce..ba210d9 100644 --- a/src/pyperclip/__init__.py +++ b/src/pyperclip/__init__.py @@ -269,7 +269,7 @@ def copy_wl(text, primary=False): p.communicate(input=text.encode(ENCODING)) def paste_wl(primary=False): - args = ["wl-paste", "-n"] + args = ["wl-paste", "-n", "-t", "text"] if primary: args.append(PRIMARY_SELECTION) p = subprocess.Popen(args, stdout=subprocess.PIPE, close_fds=True)