homepage

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
Title: argparse: terminal width is not detected properly
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.3, Python 3.4
process
Status: closed Resolution: duplicate
Dependencies: Superseder: argparse: terminal width is not detected properly
View: 13041
Assigned To: Nosy List: zbysz
Priority: normal Keywords: patch

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

Files
File name Uploaded Description Edit
patch1.diff zbysz, 2011年09月24日 22:07 review
Messages (2)
msg144508 - (view) Author: Zbyszek Jędrzejewski-Szmek (zbysz) * Date: 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) * Date: 2011年09月24日 22:48
Hm, I have somehow submitted the same tex ttwwiiccee. Sorry about that.
History
Date User Action Args
2022年04月11日 14:57:21adminsetgithub: 57251
2011年09月24日 22:48:08zbyszsetmessages: + msg144511
2011年09月24日 22:12:15ezio.melottisetstatus: open -> closed
resolution: duplicate
superseder: argparse: terminal width is not detected properly
stage: resolved
2011年09月24日 22:07:20zbyszcreate

AltStyle によって変換されたページ (->オリジナル) /