Denilson Figueiredo de Sá <denilso...@gmail.com> added the comment:

Zbyszek, I just looked at [1] and I disagree that the environment variable 
should have higher precedence. In fact, I believe it should have lower 
precedence, and should be used as a fallback.

[1]: http://bugs.python.org/file23241/patch1.1.diff

Reason? Imagine a program is launched, and thus it has COLUMNS set to some 
value. While the program is running, the user resizes the terminal. I believe 
(though I have not tested) that the envvar will keep the old value, and this 
function would return wrong dimensions.

In my opinion, the system-specific code (termios/windll) should be tried first, 
and then the envvars (as fallback). If all else fails, maybe it would be better 
to return (None, None) and let the caller of this function handle that.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue13609>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to