BUG: Fixed tput output on windows by TomAugspurger · Pull Request #16496 · pandas-dev/pandas (original) (raw)

This came up in dask. For reasons I don't understand, you can end up with a bunch of warnings like tput: terminal attributes: No such device or address when pandas calls get_terminal_size

I was able to monkey patch those calls with shutil.get_terminal_size and verify that the warnings were fixed. However that's python3 only. This change uses shutil.get_terminal_size when possible, and falls back to our prior implementation otherwise.

Not sure about unit tests, but manually, the output matches on my mac.