Message379773
When shutil.get_terminal_size() is used in a PTY, the os.get_terminal_size() call can return (0, 0).
With the pty script from https://github.com/python/mypy/issues/8144#issue-537760245:
$ python3 t.py python3 -c 'import shutil; print(shutil.get_terminal_size())'
os.terminal_size(columns=0, lines=0)
While the following cases *are* handled by returning the fallback:
- COLUMNS or lines being non-existent or 0
- os.get_terminal_size raising
The case of os.get_terminal_size() succeeding but returning (0, 0) should probably be handled the same way as well.
This e.g. affects mypy when run with pre-commit:
https://github.com/pre-commit/mirrors-mypy/issues/29 |
|
Date |
User |
Action |
Args |
2020-10-27 16:32:31 | The Compiler | set | recipients:
+ The Compiler, giampaolo.rodola, tarek |
2020-10-27 16:32:31 | The Compiler | set | messageid: <1603816351.29.0.440046743483.issue42174@roundup.psfhosted.org> |
2020-10-27 16:32:31 | The Compiler | link | issue42174 messages |
2020-10-27 16:32:30 | The Compiler | create | |
|