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

Handle empty clipboard or non-text under Windows #30

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

clach04
Copy link
Contributor

@clach04 clach04 commented Nov 12, 2016

On a newly booted Windows machine clipboard will be empty (or if clipboard explicitly cleared).

Test case:

#!/usr/bin/env python


import os
import sys

import win32clipboard
import win32con

import xerox

win32clipboard.OpenClipboard() 
x = win32clipboard.EmptyClipboard()
# next get will raise; TypeError: Specified clipboard format is not available
win32clipboard.CloseClipboard() 
print type(x)
print repr(x)
print '-' * 65

x = xerox.paste()
print type(x)
print repr(x)

@clach04
Copy link
Contributor Author

clach04 commented Dec 4, 2016

@kennethreitz have you had chance to review this? This resolves a crash. Thanks!

@clach04
Copy link
Contributor Author

clach04 commented Jul 8, 2021

@adityarathod looks like you are the new maintainer for Xerox? This PR addresses a crash on Windows which I believe is mergable without conflict.

I have another feature branch with HTML (Windows only) support if that's of interest :) My main branch is https://github.com/clach04/xerox which has all my changes.

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

Successfully merging this pull request may close these issues.

1 participant