Skip to content

Commit

Permalink
BUG: Fixed tput output on windows (pandas-dev#16496)
Browse files Browse the repository at this point in the history
  • Loading branch information
TomAugspurger authored and stangirala committed Jun 11, 2017
1 parent b8a989b commit d7fee8b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
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 @@ -38,6 +38,8 @@ Bug Fixes
~~~~~~~~~
- Fixed issue with dataframe scatter plot for categorical data that reports incorrect column key not found when categorical data is used for plotting (:issue:`16199`)

- 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

0 comments on commit d7fee8b

Please sign in to comment.