Skip to content

curses.chgat() moves cursor, documentation says it shouldn't #62869

Closed

Description

@productivememberofsociety666
BPO 18669
Nosy @berkerpeksag, @serhiy-storchaka, @NoSuck
PRs
  • bpo-18669: Corrected documentation for window.chgat in curses module #1430
  • Files
  • chgat-bug.py: Code demonstrating curses.chgat() moving the cursor.
  • 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 = 'https://github.com/serhiy-storchaka'
    closed_at = <Date 2017-11-04.08:45:58.154>
    created_at = <Date 2013-08-06.14:42:50.692>
    labels = ['extension-modules', 'easy', 'type-bug', '3.7', 'docs']
    title = "curses.chgat() moves cursor, documentation says it shouldn't"
    updated_at = <Date 2017-11-04.08:49:25.112>
    user = 'https://bugs.python.org/productivememberofsociety666'

    bugs.python.org fields:

    activity = <Date 2017-11-04.08:49:25.112>
    actor = 'serhiy.storchaka'
    assignee = 'serhiy.storchaka'
    closed = True
    closed_date = <Date 2017-11-04.08:45:58.154>
    closer = 'serhiy.storchaka'
    components = ['Documentation', 'Extension Modules']
    creation = <Date 2013-08-06.14:42:50.692>
    creator = 'productivememberofsociety666'
    dependencies = []
    files = ['31178']
    hgrepos = []
    issue_num = 18669
    keywords = ['easy']
    message_count = 5.0
    messages = ['194552', '220998', '221533', '292350', '305545']
    nosy_count = 5.0
    nosy_names = ['docs@python', 'berker.peksag', 'serhiy.storchaka', 'productivememberofsociety666', 'IronGrid']
    pr_nums = ['1430']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue18669'
    versions = ['Python 2.7', 'Python 3.6', 'Python 3.7']

    Activity

    1. productivememberofsociety666 commented on Aug 6, 2013

      productivememberofsociety666mannequin
      MannequinAuthor

      According to docs.python.org/2/library/curses.html#chgat (or any other version), curses.chgat() is not supposed to move the cursor at all.

      This is true if you don't give it x,y coordinates, but if you do, the cursor does in fact move to those coordinates, since it then uses C curses's mvchgat() internally and doesn't correct the position afterwards.

      See included file for demonstration:

      Expected output is:
      one
      two

      Actual output is:
      two

      Fix the documentation or fix the code :-)

    2. BreamoreBoy commented on Jun 19, 2014

      BreamoreBoymannequin
      Mannequin

      Can we have a comment on this please.

    3. NoSuck commented on Jun 25, 2014

      NoSuckmannequin
      Mannequin

      I get this error with 3.2.3, running Debian Stable.

      It's annoying because this error prevents curses apps from being able to highlight the current line.

    4. berkerpeksag commented on Apr 26, 2017

      @berkerpeksag
      Member

      I think this is a documentation issue. curses.chgat() documentation tries to describe different signatures in one place and some of these signatures change the behavior of the function. For example, curses.chgat() calls mvwchgat() when users pass y and x to it and mvwchgat() is documented as "the mvwchgat function does a cursor move before acting".

    5. serhiy-storchaka commented on Nov 4, 2017

      @serhiy-storchaka
      Member

      New changeset b838cc3 by Serhiy Storchaka (Chillar Anand) in branch 'master':
      bpo-18699: Corrected documentation for window.chgat in curses module (bpo-1430)
      b838cc3

      New changeset 6dbecd2 by Serhiy Storchaka (Miss Islington (bot)) in branch '3.6':
      bpo-18699: Corrected documentation for window.chgat in curses module (GH-1430) (bpo-4271)
      6dbecd2

      New changeset fd38819 by Serhiy Storchaka in branch '2.7':
      [2.7] bpo-18699: Corrected documentation for window.chgat in curses module (GH-1430). (bpo-4272)
      fd38819

      There is a typo in the issue number in commit messages.

    6. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Labels

    3.7 (EOL)end of lifedocsDocumentation in the Doc direasyextension-modulesC modules in the Modules dirtype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions