[New-bugs-announce] [issue13041] argparse: terminal width is not detected properly

Zbyszek Szmek report at bugs.python.org
Sun Sep 25 00:07:19 CEST 2011


New submission from Zbyszek Szmek <zbyszek at in.waw.pl>:

COLUMNS is a shell variable (updated whenever the window size
changes), that usually isn't exported to programs. Therefore checking
for COLUMNS in sys.environ will not work in the majority of cases. The
proper check is to use the TIOCGWINSZ ioctl on stdout.
    
Why COLUMNS is not exported? Because it can change during the lifetime
of a program. Therefore it is better to use the dynamic ioctl.

----------
components: Library (Lib)
files: patch1.diff
keywords: patch
messages: 144507
nosy: zbysz
priority: normal
severity: normal
status: open
title: argparse: terminal width is not detected properly
type: behavior
versions: Python 3.3, Python 3.4
Added file: http://bugs.python.org/file23238/patch1.diff

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue13041>
_______________________________________


More information about the New-bugs-announce mailing list