Skip to content

Commit

Permalink
wayland: request text type to wl-paste
Browse files Browse the repository at this point in the history
This fixes UnicodeDecodeError while the clipboards contains images or other types of content
  • Loading branch information
nik012003 committed Jan 22, 2024
1 parent 781603e commit 5134a30
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/pyperclip/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 5134a30

Please sign in to comment.