This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
标题: argparse: terminal width is not detected properly
类型: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.3, Python 3.4
process
状态: closed Resolution: duplicate
Dependencies: 后续: argparse: terminal width is not detected properly
View: 13041
分配给: 抄送列表: zbysz
优先级: normal 关键字: patch

Created on 2011-09-24 22:07 by zbysz, last changed 2022-04-11 14:57 by admin. This issue is now closed.

文件
文件名 上传时间 Description 编辑
patch1.diff zbysz, 2011-09-24 22:07 review
Messages (2)
msg144508 - (view) Author: Zbyszek Jędrzejewski-Szmek (zbysz) * 日期: 2011-09-24 22:07
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.
msg144511 - (view) Author: Zbyszek Jędrzejewski-Szmek (zbysz) * 日期: 2011-09-24 22:48
Hm, I have somehow submitted the same tex ttwwiiccee. Sorry about that.
历史
日期 用户 动作 参数
2022-04-11 14:57:21admin修改github: 57251
2011-09-24 22:48:08zbysz修改消息: + msg144511
2011-09-24 22:12:15ezio.melotti修改状态: open -> closed
resolution: duplicate
后续: argparse: terminal width is not detected properly
stage: resolved
2011-09-24 22:07:20zbysz创建