• [x] I have checked that this issue has not already been reported.

  • [x] I have confirmed this bug exists on the latest version of pandas.

  • [ ] (optional) I have confirmed this bug exists on the master branch of pandas.


Note: Please read this guide detailing how to provide the necessary information for us to reproduce your bug.

Code Sample, a copy-pastable example

N/A

Problem description

I've been running into an issue lately where when is use to_clipboard the results paste into excel with a lot of garbled text. Any idea what can be going on here? I haven't found any minimal example to consistently reproduce, but it is happening a lot for me. to_excel still works interestingly enough, but I do prefer the convenience of the clipboard.

Expected Output

Not this: Pandas BUG: Getting garbled characters when using pd.to_clipboard()

Here's another to verify that it is rather random what I get: Pandas BUG: Getting garbled characters when using pd.to_clipboard()

Output of pd.show_versions()

Does work for me. I get the following error:
ImportError: Can't determine version for tables
I'm on pandas 1.2.2 though

Comment From: mbkupfer

I now believe this is WSL related as I've tested with the same dataframe on my windows host and it copies fine.

Comment From: mroeschke

If this is a WSL issue I don't think there can be much done on the pandas side so closing. If there is some fix that required updating our vendored version of pyperclip feel free to raise a new issue