We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Exception in the following code locks clipboard system-wide until I exit my interactive Python session:
import pandas as pd df = pd.DataFrame.from_dict({1: u' \u2014'}, 'index') df.to_clipboard() --------------------------------------------------------------------------- UnicodeEncodeError Traceback (most recent call last) <ipython-input-58-1f8b11f0ff98> in <module>() ----> 1 df.to_clipboard() C:\Python27\lib\site-packages\pandas\core\generic.pyc in to_clipboard(self, excel, sep, **kwargs) 1000 from pandas.io import clipboard -> 1001 clipboard.to_clipboard(self, excel=excel, sep=sep, **kwargs) 1002 1003 #---------------------------------------------------------------------- C:\Python27\lib\site-packages\pandas\io\clipboard.pyc in to_clipboard(obj, excel, sep, **kwargs) 95 else: 96 objstr = str(obj) ---> 97 clipboard_set(objstr) C:\Python27\lib\site-packages\pandas\util\clipboard.pyc in winSetClipboard(text) 63 try: 64 # works on Python 2 (bytes() only takes one argument) ---> 65 hCd = ctypes.windll.kernel32.GlobalAlloc(GMEM_DDESHARE, len(bytes(text))+1) 66 except TypeError: 67 # works on Python 3 (bytes() requires an encoding) UnicodeEncodeError: 'ascii' codec can't encode character u'\u2014' in position 10: ordinal not in range(128)
pandas 0.14.1
The text was updated successfully, but these errors were encountered:
where its failing is copied from pyperclip. (though its included in pandas under license). So it is possible to modify.
pyperclip
I suppose you can just do those windows locks in a with. Though I am not really familiar with how windows works in that regard.
with
Sorry, something went wrong.
closing as stale. pls reopen if still an issue.
No branches or pull requests
Exception in the following code locks clipboard system-wide until I exit my interactive Python session:
pandas 0.14.1
The text was updated successfully, but these errors were encountered: