Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backwards incompatibility introduced in 0.6.0 #12

Open
spyoungtech opened this issue Mar 21, 2022 · 1 comment
Open

Backwards incompatibility introduced in 0.6.0 #12

spyoungtech opened this issue Mar 21, 2022 · 1 comment

Comments

@spyoungtech
Copy link
Owner

#10 introduced a new behavior incompatible with older versions of pyclip.

Specifically, binary data which happens to be a string is no longer copied to the clipboard as a text format. This means that this data won't be able to be pasted into programs looking for text formats.

Previously:

echo foo | pyclip copy

would allow the data to be pasted into another application like Notepad. However, in v0.6.0 this no longer works.

@spyoungtech
Copy link
Owner Author

Probably should do something like what the MacOS variant does:

pyclip/pyclip/macos_clip.py

Lines 117 to 122 in 75bbe62

if isinstance(data, bytes):
try:
data = data.decode()
self.pb.set_contents(data)
except UnicodeDecodeError:
self.pb.set_contents(data, self._bytes_type)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant