Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

argparse: terminal width is not detected properly #57251

Closed
zbysz mannequin opened this issue Sep 24, 2011 · 2 comments
Closed

argparse: terminal width is not detected properly #57251

zbysz mannequin opened this issue Sep 24, 2011 · 2 comments
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@zbysz
Copy link
Mannequin

zbysz mannequin commented Sep 24, 2011

BPO 13042
Superseder
  • bpo-13041: argparse: terminal width is not detected properly
  • Files
  • patch1.diff
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2011-09-24.22:12:15.135>
    created_at = <Date 2011-09-24.22:07:20.177>
    labels = ['type-bug', 'library']
    title = 'argparse: terminal width is not detected properly'
    updated_at = <Date 2011-09-24.22:48:08.875>
    user = 'https://bugs.python.org/zbysz'

    bugs.python.org fields:

    activity = <Date 2011-09-24.22:48:08.875>
    actor = 'zbysz'
    assignee = 'none'
    closed = True
    closed_date = <Date 2011-09-24.22:12:15.135>
    closer = 'ezio.melotti'
    components = ['Library (Lib)']
    creation = <Date 2011-09-24.22:07:20.177>
    creator = 'zbysz'
    dependencies = []
    files = ['23239']
    hgrepos = []
    issue_num = 13042
    keywords = ['patch']
    message_count = 2.0
    messages = ['144508', '144511']
    nosy_count = 1.0
    nosy_names = ['zbysz']
    pr_nums = []
    priority = 'normal'
    resolution = 'duplicate'
    stage = 'resolved'
    status = 'closed'
    superseder = '13041'
    type = 'behavior'
    url = 'https://bugs.python.org/issue13042'
    versions = ['Python 3.3', 'Python 3.4']

    @zbysz
    Copy link
    Mannequin Author

    zbysz mannequin commented Sep 24, 2011

    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.

    @zbysz zbysz mannequin added stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error labels Sep 24, 2011
    @zbysz
    Copy link
    Mannequin Author

    zbysz mannequin commented Sep 24, 2011

    Hm, I have somehow submitted the same tex ttwwiiccee. Sorry about that.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant