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

BUG: Fixed tput output on windows #16496

Merged
merged 1 commit into from
May 30, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions doc/source/whatsnew/v0.20.2.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ Performance Improvements
Bug Fixes
~~~~~~~~~

- Silenced a warning on some Windows environments about "tput: terminal attributes: No such device or address" when
detecting the terminal size. This fix only applies to python 3 (:issue:`16496`)
- Bug in using ``pathlib.Path`` or ``py.path.local`` objects with io functions (:issue:`16291`)
- Bug in ``DataFrame.update()`` with ``overwrite=False`` and ``NaN values`` (:issue:`15593`)

Expand Down
6 changes: 6 additions & 0 deletions pandas/io/formats/terminal.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
from __future__ import print_function

import os
import sys
import shutil

__all__ = ['get_terminal_size']

Expand All @@ -26,6 +28,10 @@ def get_terminal_size():
IPython zmq frontends, or IDLE do not run in a terminal,
"""
import platform

if sys.version_info[0] >= 3:
return shutil.get_terminal_size()

current_os = platform.system()
tuple_xy = None
if current_os == 'Windows':
Expand Down