[pypy-issue] Issue #2316: os.get_terminal_size() is missing on PyPy3 (HG py3k branch) (pypy/pypy)

Chi Hsuan Yen issues-reply at bitbucket.org
Tue Jun 7 00:15:10 EDT 2016

New issue 2316: os.get_terminal_size() is missing on PyPy3 (HG py3k branch)

Chi Hsuan Yen:

As title, ```os.get_terminal_size()``` is not implemented yet, so ```shutil.get_terminal_size()``` failed:
$ pypy3 -c 'import shutil; shutil.get_terminal_size()'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/opt/pypy3/lib-python/3/shutil.py", line 1058, in get_terminal_size
    size = os.get_terminal_size(sys.__stdout__.fileno())
AttributeError: 'module' object has no attribute 'get_terminal_size'
PyPy version:
$ pypy3 --version
Python 3.3.5 (ef5a7f148b27+, Jun 06 2016, 20:48:46)
[PyPy 5.3.0-alpha0 with GCC 6.1.1 20160501]
Downstream bug: in youtube-dl, we rely on ```hasattr``` to check whether ```shutil.get_terminal_size()``` is available or not. [1]

[1] https://github.com/rg3/youtube-dl/blob/e67f688/youtube_dl/compat.py#L548

More information about the pypy-issue mailing list